Leaderboard
Popular Content
Showing content with the highest reputation on 03/23/2012 in all areas
-
Hey folks! I'm working on a couple new things for the TinyMCE inputfield in PW to extend it's capabilities toward using third-party plugins and html snippet templates (part of tinymce already). The thing is, until now you can only implement those stuff if you change the core distribution of it. Not any longer! I worked out a simple config setup that will give you all the freedom to use it on a per field basis even. So you could setup various templates or plugins for each TinyMCE field separate. For those interested in checking it out and help testing, I attached a folder with a updated "inputfieldTinyMCE" folder, and additionally added a "tinymce" folder which can be put where you want, but would suggest to put it in your /site/ folder. InputfieldTinyMCE folder is the one in /wire/modules/Inputfield/.. replace it with this new one. The tinymce folder contains some files already. plugins > - bramus_cssextras // advanced custom styles/ids via content.css template > - body_template1.html - content.css - body_templates.js The "bramus_cssextras" plugin is a great third-party plugin: http://www.bram.us/p...amus_cssextras/ I included this as an example how to load third-party plugins. And I use it in all PW projects already. "body_templates.js" is where you can specify templates which will be available, you then only specify the path to this in the custom field settings, it is like a proxy with an array of templates. It could be even a .php file! This is part of TinyMCE and documentation can be found here: http://www.tinymce.c...Plugin:template . To use template you also need to add "template" button and "template" plugin to enable it. "content.css" is the css you can add the path to this also in the advanced field settings. I would really appreciate any help with testing! Feel free to try install any other third-party plugins (not tinymce core plugins), or test out templates. Also attached a screenshot of the field settings I used to test this all with this setup. Again in Text form: theme_advanced_buttons1: formatselect,bramus_cssextras_classes,bramus_cssextras_ids,|,bold,italic,|,bullist,numlist,|,link,unlink,|,image,|,code,|,fullscreen,|,template plugins: inlinepopups,safari,table,media,paste,fullscreen,preelementfix,template content_css: /site/tinymce/content.css Additional TinyMCE settings: template_external_list_url : /site/tinymce/body_templates.js Third-party Plugins: bramus_cssextras : /site/tinymce/plugins/bramus_cssextras PW-TinyMCE-setup-test3.zip3 points
-
Oh, man. I'm having to go back to WordPress for this project that's on a tight timeframe, and every single thing I do, whether it's trying to find an appropriate plugin, or hacking the ThemeForest theme to get something to work, I keep thinking of how I'd just do it the right way in ProcessWire. Sooo painful. I can't wait until I get to use PW again!2 points
-
The best bit I find is in this case (or in any ProcessWire code samples for that matter) is that whilst not all of those things would necessarily be that useful in that particular context, you can see how you might just grab a company's users to display on the company page, or company details on the author's page and so on - I just love the ease at which you can get at related content from whatever angle you like in one or two lines of code, just leaving you with the fun job of outputting it on the screen. Anything that lets someone as impatient as I am output the finished result to the screen in as little time as possible is great, and from a business point of view the hours of work it saves and the legibility of the code that's produced are invaluable, especially when it comes to re-using similar code in other websites. A fun thing I did recently was to implement a gallery page on a website and that had child pages for different gallery sections. The whole thing took about 20 minutes and about as many lines of PHP and HTML2 points
-
The best thing I've had fun playing with recently is chaining in PW, and it's worth knowing about. Here's a good, slightly abstract example: On a large communal news website, an Article page has a PageField called Author - this links to the Author's page. The Author works for a Company - there might be several authors in that company writing on this website and you might be curious and want to find out various things like the following (pretend we're on the article page still): // Let's find all articles by this author: $author_articles = $pages->find("template=article,author=$page->author"); // Let's get the company name that this author works for - going through a few pages to get this one - from the article to the the author' page then the company page - all using the incredibly powerful PageField field type echo $page->author->company->title; // Ridiculously simple huh? // Now let's grab a list of other authors from this company - not sure why you would, but you could (the authors are all PW users in this case, so the template is 'users') $company_authors = $pages->find("template=user,company=$page->author->company"); // And finally let's get a list of all articles written by all authors in this company using $company_authors above $company_articles = $pages->find("template=article,author=$company_authors"); Now some people might wonder how the last one works - surely $company_authors is an object or array right? Well if you run a simple echo on it, it doesn't spit it's dummy out like PHP normally would, but rather gives you a concatenated list of page IDs in the format: 123|124|1024|456 - the pipe character is used in the last $page->find to mean "OR" so it works perfectly. And this is why I keep getting excited whenever I work with ProcessWire. I would need literally dozens of lines of code to recreate that example in any other CMS I can think of. I pulled in the articles and authors by template, but there are various ways of doing it and I just did it with template names as that didn't assume any particular site structure, so it's not necessary to follow that exactly. Have fun!2 points
-
Hi Ryan, When adding and editing siblings, going back and forth to the page tree seems to slow down the process quite a bit. What if there were links to some common things like: prev, next, add new (or add sibling) when you are in edit mode? I attached a quick mockup, not necessarily for placement purposes, just as a visual aid. I'm still very new to PW, so there might be better methods already, just thought I would throw this out there as a feature request.1 point
-
There is a module to automatically put you back to the right place in the page tree (ListAfterSave) that can speed things upa bit when adding lots of new content, but that's not quite the same. I do miss some options I had in MODx - Save & Contnue Editing, Save and Exit and Save & Add Another Page (can't remember the short names for them any more). I do like your idea of next and prev as well, and would be reasonably easy to do in PW. I keep meaning to have a look at this so might give it a dabble this weekend.1 point
-
soma yo can no| $wire->zam in modulos o classos. wire('zam') must it.be bill getAttr beauty i.use good,thanking1 point
-
Site putt.together am i brougt inputfield lexicon or process with usrs many do. when alphabateze multi page informations wher.e dos selection vs multioption selectins value's with process wire? mixture.with tamplate and filters and fields, suggest grate would so? helpfal.kind vanced, much,thank too.1 point
-
Welcome Ryan, happy if it helps at all. And I had been adding/removing/adding/removing/adding/removing fields, templates, pages called "tags" in my (feeble) search to work out how to do what in the end Pete showed me was wonderfully simple (as I knew it would be! ) So I have zero loss in confidence from that error condition.1 point
-
you can also do this: $image = $profile->images->first(); echo "<img src='{$image->url}' height='{$image->height}' width='{$image->width}' alt='{$image->get('description|name')}' />"; in PW you can also access values of fields using get(). Adding a | between multiple names will return the first populated behaving like an "or" operand. echo $page->get("headline|title");1 point
-
Ben, I doubt this will help you directly, but just bookmarking this post as it has an interesting use of ProcMon to track down the same exception code in php5ts.dll. Edited to add: Thinking aloud from this idea. Perhaps PHP is writing to an error log file and there is some contention over that?1 point
-
Hi Ben, Thanks for posting that. Back to your original question re: slicing and dicing to find out what's going on. Some thoughts, incomplete and in no particular order... If you have access to a Linux box I'd try running your ap stress test there to see if it is isolated to Windows. If I only had a Windows box, I'd now try verifying that each of the bundled php modules (especially MySQLi) is also compiled thread-safe. Can you identify any components that PW is exercising that the other CMS systems aren't (ie. are they using the MySQL module instead of PWs MySQLi?) Although it's from a while back, there is a report here of a similar looking issue.1 point
-
Brilliant works perfectly, thanks Pete! And thanks for the link to the other post, gonna go read. I have one problem that is likely down to me creating/deleting pages, templates, fields called tag and tags all afternoon — each time I go to edit any page I am getting: Invalid value sent to Page::setTemplate Do you think I would be well advised restoring from a db backup? Or should I try to work out a fix in case this happens again or is of interest? Correction, this happens for some pages, just working out what the common link is... Update: Backed up and saved 'broken' db in case of help to you Pete/Ryan etc and then restored and re-created the items I needed and all works perfectly, thanks again!1 point
-
That's what I had to learn too. You can look at it from a jQuery point of view. Select/find the element you want to use and do something. That's why I posted the cheat sheet. It's pretty straight-forward. I've got a feeling I've barely scratched the surface, but I do see it's potential. That why PW rocks.1 point
-
No thank you for doing so much for Content Management Systems Anyway, I think this is a matter of preference - you obviously like to know what is code doing by looking at what function you're using. I, on the other hand, prefer the 'here is add method, it will deal with whatever you choose to pass as parameter'. I think it's very nice that you, as a lead developer discuss stuff with community-healthy discussion beat anything else, when it comes to collaboration.1 point