Jump to content

Martijn Geerts

PW-Moderators
  • Posts

    2,769
  • Joined

  • Last visited

  • Days Won

    31

Everything posted by Martijn Geerts

  1. This is awesome. Now thinking maybe we should have the option in config to restrict certain browsers that are not compatible with HTML5. After setting $config->allowOnlyModernBrowsers = true; ( or something ) PW admin restricts access & give alternatives.
  2. The things I think are time savings: Take your time to study the Blog profile & read the delegate approach article are time consuming at first, but a big time saver after all. Learn some basic regex. Using the right css framework for a specific job. (I like Zurb Foundation & Skelleton) Study a lot !
  3. Thank you for mentioning it. Learning every day
  4. Maybe next to the save button a create sibling after save checkbox that remembers your last choice.
  5. or: $u = new WireUpload('uploads'); // from $_FILES['uploads'] $u->setMaxFiles(5); $u->setOverwrite(false); $u->setDestinationPath($uploadpage->images->path); $u->setValidExtensions(array('jpg', 'jpeg', 'gif', 'png')); // execute() returns an array, so we'll foreach() it even though only 1 file foreach($u->execute() as $filename) { $img = new Pageimage($uploadpage->images, $filename); $img->description = "what you want"; $uploadpage->images->add($img); } $uploadpage->save(); Think this should work
  6. switchin between Skeleton & zurb. Depends on project. Love skeleton because it's tiny.
  7. Create the page and save it, (your page is now ready to receive images) then loop through the uploaded images and add the images one by one to the $page variable you created before. don't forget to "$createdPage->setOutputFormatting(false);" each time before saving the page.
  8. Love the responsiveness. Maybe the container width wider than 85%. Space is precious
  9. I don't know What CLI is & if you use it boot strapped/included it's better not to use $page, as you can't see it on the variable name. Maybee you should give some more descriptive name.
  10. I don't know where $url comes from? ($p = wire('pages')->get('/path/'); Or in your template: $pages->get('/path/'); Next, $page is a "predefined" variable. $page is provided to the template in PW as ryan mentioned. (the current page).
  11. Then I think you should create a parent somewhere in the admin tree. And put pages in it with template with 2 fields. (template name header-image or something you like) Field 1 = title Field 2 = image field ( allow only 1 image to be upload in there ) The create a Field type of Page, select The parent & if you wish, select the template. Put that field to the template from where you want to select the page that contains the header image.
  12. For these header images, I use the images in the home page as fallback sometimes. (You could make a 2nd images field for this ) Or you setup a field with the type of page, and let them select where the header image is. Then you could pick it up in your template. $headerImages = $page->nameOfFieldTypePage->images; // Array with images (if images are provided)
  13. Closing php and opening php again many times, cluthers the readibility. Think the code below is much more human readable: <?php $output = ''; $class = 'item'; foreach ($galleries as $gallery) { $status = ''; if ($gallery === $galleries->first()) $status .= ' active'; $class .= $status; $output .= "<div class='{$class}'> <a href='{$gallery->url}'> <img src='{$gallery->images->first()->url}' alt='' /> <h6>{$gallery->title}</h6> </a> </div>"; } echo $output; ?> (ps did not test it)
  14. Sorry onjegolders, didn't saw your post. You're on the right way right now....
  15. If you bootstrapped it, don't know for sure if you can asked pages with $pages->get... etc. wire('pages')->get('/lalala/')->children(); would work then....
  16. I think PW is the right CMS. The amazing api in your hands everywhere. Doing it the PW way it's much more direct then the MODX way. And interact with the logged in state in PW is so much more easy & friendly. Why I said I don't think it is the right way it's because, lots of people don't like to make an account everywhere. They're more comfortable just using facebook, google+ or some other login that they can use. I think to have community login extended with oauth2 will have much more success then without.
  17. Started with BBEdit, switched to Textmate tried Sublime 2 and back to BBedit.
  18. There's a lot of "community" code in here: http://processwire.com/talk/topic/1742-problem-with-this-setkey-value-in-own-methode/ didn't continue it cause I think I was not the right way to do it.
  19. tnx SiNNuT & Sorry for double posting...
  20. ProcessWire 2.2.10 (dev branche) when installing complains about json support. PHP Version 5.3.17 phpinfo says: json json support enabled json version 1.2.1 If ignored, the install looks o.k.
  21. @netcarver: didn't know that, tnx...
  22. Martijn Geerts

    FYI :-)

    Good catch :-P But I feel the same about MODX vs PW
  23. +1 for tools in menu.
  24. This is a nice example of using hooks. Tomorrow gonna see what is going on with the line: "$this->user->editable_pages->has($event->object);" as I don't understand it right now. One point. Why don't you use: $this->message($this->_("Added field 'editable_pages' to the user template.")); etc...
  25. The core, al those modules the API, you call it... You're making the best CMS there is even better every day. Thanks Ryan!
×
×
  • Create New...