Jump to content

Pete

Administrators
  • Posts

    4,054
  • Joined

  • Last visited

  • Days Won

    67

Everything posted by Pete

  1. Resurrecting this slightly, but I did something along these lines just now with help from this thread (actually approached it netcarver's suggested way from the first post). It's one where I wanted to skip the first page of adding a name (for events in a calendar) but didn't want to use a repeater - which would achieve the same, but I wanted separate pages. Code as follows: In init function: $this->pages->addHookBefore('ProcessPageAdd::execute', $this, 'generateName'); The function that does the work (specific to my case): public function generateName() { if ($this->input->get->parent_id == 1019) { // 1019 = some page where we want to auto-generate child page names $page = new Page(); $page->parent = $this->input->get->parent_id; $page->name = $this->pages->get($this->input->get->parent_id)->count()+1; $page->template = 'child-template-name'; $page->addStatus(Page::statusUnpublished); $page->save(); $this->session->redirect("../edit/?id=$page"); } } So it checks we're creating a page under a certain parent, sets the right template, creates a page using an integer as the name based on the count of pages under the parent page and then takes you to the edit form for that page. The beauty of it is that since there has been no title entered so far, the user has to fill out the page fields - well title at least - to continue. So why did I do something so convoluted here? Because for what I'm using the title field for I needed to allow duplicate titles, so different names is key to this. The individual pages themselves will never be visited - they're just being pulled into a table into the parent page. Of course I could have used repeaters, but on this occasion I didn't want to. I think that with a little work, and the addition of multiple config lines like in my ProcessEmailToPage module you could expand this to monitor certain parent pages, hook into new page creation and create the page with a specific child template nice and neatly instead of hardcoding it as above. When I get time I might just do that... which might not be any time soon For now the above code works though for anyone wanting to adapt it to do something similar.
  2. I've updated the CKEditor plugin to work for multiple languages too. Embarassingly I've forgotten how to do a pull request for someone else's repo on Github, so here's the changed .js file - just put it in site\modules\InputfieldCKEditor\ckeditor-4.2.0\plugins\pwlink It's largely based on Soma's code but altered marginally for CKEditor. plugin.zip
  3. Love it, looks like it was a perfect match for ProcessWire (as in I can see how everything would work, like staring at The Matrix when browsing the site ). I look forward to reading the case study
  4. Pete

    GoPHP5: The Revenge

    Alert is good - turns out with an update to another CMS a while ago there were too many sites that I had to update, whereas if it had been a scheduled part of my monthly checks then it would have felt less onerous. Of course if I switched them all to ProcessWire I'd also be fine But alert is good even with PW.
  5. Yep, but Wordpress wouldn't put his name, they'd put Automattic Inc. instead as that's the company behind it isn't it? That's the point I was trying to make, badly It seems now that I've re-read some of the earlier posts in this topic that it must stay as it is for now or until ryan gets some clarification from a legal perspective. The reasoning for leaving the ProcessWire name in plain view though is clear - whilst a client's next developer (should their current developer vanish) can see what the system is built in from the license files and so on in the installation folder, most clients wouldn't know they're there. Having something in plain sight enables them to get help from here if something goes wrong - this has in fact already happened once I think where a client has parted ways with their dev and come here for help, so we know it works and it helpful. I very much doubt there would be anything wrong with expanding upon the copyright line though by doing something like this, which clarifies things nicely: ProcessWire 2.3.5 © 2013 Ryan Cramer | Website designed and developed by YourCompany I daresay you could even prepend the words "Built with..." to that as well for even more clarity.
  6. Pete

    GoPHP5: The Revenge

    There's obviously merit to using newer versions of PHP and it would be nice to force hosts to be more up to date as this would in turn force software devs to keep up to date, as many already do, but I'm just not sure it would catch on. That said, it would probably only take a few of the more commonly-used programs like WordPress to push this and I could see it happening, definitely. I'd rather see it as a group effort though, with many devs throwing their hats into the ring and everyone getting a more equal share of the kudos surrounding the initiative, even if you do have to tout some big names to get some momentum.
  7. Tackling a small part of what has been discussed first, I don't think white-labelling completely is a good idea at this stage. Wordpress has a very strong identity with their admin, and anyone who has used it would know what they were using without the branding unless they were using some really fancy admin themes. Whilst a system is still growing in popularity and can benefit from the simply line of text and the link back to the website I personally think it should remain. Wordpress, depending on the version, has one or more links in the footer linking back to the website just with the software name. MODx is managed under the company name "MODX Systems, LLC" so it's a bit easier for them to simply list "MODx" in their footer. ProcessWire is by "Ryan Cramer Design, LLC" (with many developers/contributors) but it would be confusing to have the full "Ryan Cramer Design" bit in the admin footer ("who designed the website?" might be what the client then asks ). Rather than me speculating further as to reasons why ryan has his name there it's probably best to wait for him to answer of course. All in all though, since I started this thread back when I'd been using ProcessWire for just a few months, I've not once come across a client who got confused by it nor have I noticed anyone else seeing it as a restriction. Obviously it would be interesting to see what ryan says, but I wouldn't see it as a show-stopper either way and I don't think other people do either or we'd probably hear a lot more concerns over it
  8. Pete

    ProcessWire on the web

    Short of murder, pretty much anything, yes.
  9. Pete

    ProcessWire on the web

    Yay! Joss is back! It just.... <sniff> wasn't the same without you
  10. I'm really confused by what you're trying to do - why would the page ever be saved before the user clicks save? If you could post a few bullet points explaining what the user will experience whilst filling out this form it might help us come up with a suggestion. Other than that there are many topics here how to save the page (http://processwire.com/talk/topic/352-creating-pages-via-api/ ) but you appear to be talking about everything up to that point which I would have thought would just be the job of a normal form?
  11. Pete

    ProcessWire on the web

    Well Evo is the "older" version anyway (Revo technically replaces is, but many users preferred Evo), but it's also not like PHP 5.5 is going to be mainstream for a while. Not making excuses, but that won't be a huge problem for many people just now pwired.
  12. Cheers teppo - good spot! I... bumped that other topic
  13. http://processwire.com/talk/topic/4812-field-names-using-arrays/ *whistles nonchalantly, hands in pockets, walking away from the topic*
  14. Pete

    ProcessWire on the web

    Just in case anyone outside ProcessWire arrives here after the last few posts, I'm not just getting riled about this on behalf of ProcessWire - there are many good systems on that list of winners, all trying to do something innovative and new. I'm equally maddened about it on behalf of MODx as I am ProcessWire for example because I've actually spent time with both in an effort to get away from the restrictions of a default WordPress installation. Both MODx and PW allow you to effortlessly create page templates without the need for plugins. And I wholly agree with Matthew - the number of plugins/modules it touted too often and has the same meaning of teenagers saying "my manhood's bigger than yours". I struggled to keep that polite, but found the right words I think.
  15. Pete

    ProcessWire on the web

    I would have thought that most people who occasionally checked the alternatives would have heard of MODx by now at least? Anyway, my assessment of that article is that it's possibly the laziest piece of writing on CMS' I've ever read. What was the point of it aside from to tell people not to bother looking at other systems? If the author had spent a little time with the systems on the list it's entirely possible the article would have been very different, but he resigned himself to just not bothering because they're not big enough instead of seeing if any were better for what he wanted. I knew it was doomed from the very moment he wrote "...and active security updates." - which means he's one of many thousands of proud bloggers and content creators who think that the alarming regularity of security patches in Wordpress are somehow a comfort. They're not. They're a sign that something is wrong. It's entirely possible that the very concept that you don't have to update the system on PW sites unless new features are needed is entirely alien to people like the author of that article. I take great comfort in the fact that ryan actively practices this (though I update all of mine just because old habits die hard, plus it's the easiest upgrade process I've ever come across). I'm slightly scathing towards this guy in this post, but it's wholly deserved I feel as instead of being an "expert" he has instead been blinkered and misleading through sheer laziness. It's pretty inexcusable on a high-traffic website to be honest. The whole thing seems to be tailored towards advertising the two he uses (one of which appears in ads on the page) however I'll concede that he did at least link to the CMS Critic awards even if he couldn't bring himself to linking to the winners' project pages.
  16. Hi folks It seems like there's an issue with using arrays in field names. For example, when I submit this: <input type="text" name="extras[$event->id][$extra->id]" value="1" /> and print the contents of $this->input->post versus printing the contents of $_POST I get different results as below: // print_r($this->input->post) gives me this: WireInputData Object ( [stripSlashes:protected] => [data:protected] => Array ( [extras] => Array ( ) ) ) // Whereas print_r($_POST) gives me this, which is what I want: Array ( [extras] => Array ( [1504] => Array ( [1499] => 1 ) ) ) I'm happy to work with $_POST instead, but wondered if there was a reason why PW's version doesn't do multi-dimensional arrays from input fields?
  17. Except it doesn't store HTML so wrapping blocks with divs isn't even a worry - silly me for not reading it further
  18. It's pretty similar to what some email marketing programs I've used in the past do. It's a neat way of saying as the admin "hey, you can play with these toys in any order you want, but we're still controlling all the containers" and it does make for something that's a bit more controllable. It would certainly be of interest I think to people writing blogs or news articles - take an average article from this site for example: http://www.rockpapershotgun.com/2013/10/23/enemy-within-preview/ - text, image, text, image and now and then a video - and it really would allow people to write articles where they like - admin or frontend - and see the layout they'll get as they're writing it. There are other front-end editors of course, but this just looks so simple. Anything like this that makes things like that simpler is going to be great, even if all it is really doing is constricting what you can and can't do - but for news and blogs that's where you don't mind having your layout controlled like that Having said all this, you would have to wrap each bit of content with a div so when you go back and edit it the blocks all come apart nicely, but that's no big deal really unless you're trying to shave off every last byte from your page load. <div class='editor-image'> or something isn't exactly going to ruin your life.
  19. EDIT: Oh, I see you already covered that
  20. I was just searching for this solution, started reading the thread and though "I hope I scroll down and it's been released as Hanna Code Good job guys! My only thought is that since the images field is installed by default it might be nice to skip the field name and have it check for a field called "images". Could go one further and, if fieldname is omitted, check for the first field that supports multiple images, but I'm getting a bit fancy there!
  21. Like it - nice work on both! Something we keep talking about every few months. Think everyone is just too busy at the moment to build a developer directory
  22. Not just an awesome ProcessWire site, but an awesome site in general! Great work - gives me lots of ideas (if only I had the time for them all ). Just chilling out to the music in the background. My only comment is that the player for the music sits a little low on the bottom of the screen. The bottom of the play and mute buttons are just off the bottom of the screen, but still clickable - I'm pretty sure the positioning was by design though so nothing major!
  23. Pete

    Minify

    Not sure - I seem to think that underscores just prevent folders from being visible to certain file systems or something so might be worth trying to rename them without underscores and seeing what happens? I don't have much time right now but can make a note to look into it soon.
  24. As long as there are fields called "body" and "blog" in the template these posts are being sent to I'm not sure what the issue might be. Does it definitely use the right template when creating the pages? Does it do anything if you remove the ==blog== delimiter? Theoretically that should post all content to the body field.
  25. Can you post an example of the body of the email please? Theoretically, if you have a field called "blog" then anything in the email before ==blog== will be posted to the "body" field, and anything after ==blog== to the blog field.
×
×
  • Create New...