Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/21/2015 in all areas

  1. I just committed a small but significant change in behavior - now if you don't select any templates or pages in the config settings, the Batch Child Editor tools will be available for all pages in your site. I have found I want access to this a lot (mostly the rename, sort, and delete functionality of the EDIT mode) and it was annoying to have to go and enable it for the template or page before I could use it, so now it can easily be available to all pages on your site. Hope everyone else finds this more convenient also.
    5 points
  2. @Macrura: I like your suggestion so updated the module with an option to use SORT_NATURAL on the options of the select. // Natural Sort (NOT checked) image_1.jpg image_12.jpg image_21.jpg image_4.jpg // Natural Sort (checked) image_1.jpg image_4.jpg image_12.jpg image_21.jpg
    4 points
  3. Just to keep PHP functions out of it $last = $pagearray->pop(); echo $pagearray->implode( ', ', 'title', array('append' => ' & ') ) . $last->title;
    3 points
  4. Just a guess, but what about the path to your query.php. You say it's in your website root, but if it's being called from a PW page, then you need to use a root relative path, likely just: url: "/query.php", Don't forget that you can find out if there was a 404 on that file in the Network tab of your dev tools console.
    2 points
  5. There are lots of options, but the two I like are: Using the template conditional options in AIOM: http://modules.processwire.com/modules/all-in-one-minify/#conditional-loading Or otherwise you can add the js script call in a variable in your template, eg: $end_head = '<script src="myscripts.js"></script>'; Then in your main.inc or whatever file is your master template, just echo out $end_head before the closing </head>. Of course you could also do this with $end_body if more appropriate for your script file.
    2 points
  6. PR has been submitted to fix those fatal errors in PHP 5.3. The other relatively minor (but niggly) thing is that the description field is not getting the InputfieldMaxWidth class applied to it and as a result, the input is very narrow. I took a quick look at the regex stuff you have going on in regard to this, but figured it was easier for you to figure out the issue with this because I haven't really figured out why you are replacing the label class and label for description, although I am sure there is good reason
    2 points
  7. Nice one Diogo But it needs a ltrim or something. $last = $pagearray->pop(); echo ltrim($pagearray->implode(', ','title') . ' & ' . $last->title, ' & ');
    2 points
  8. Edit: Somehow I had something crazy and wrong in mind with this. if(count($pagearray) > 2){ $last = $pagearray->pop(); echo $pagearray->implode(', ', 'title') . ' & ' . $last->title; }else echo $pagearray->implode(', ', 'title');
    2 points
  9. -------------------------------------------------------------------------------------------------------------------------------- for PW 3.0+ please follow this link! -------------------------------------------------------------------------------------------------------------------------------- Croppable Image Module for PW >= 2.5.11 and PW <= 2.7.3 Version 0.8.3 alpha Hey, today I can announce an early (alpha) release of CroppableImage, what was forked from Anttis Thumbnails module. Until now there was a lot of work done by owzim, Martijn Geerts and me. We have solved the issues regarding the list from here: The modules are bundled together so that you only can and have to use FieldtypeCroppableImage for install, uninstall & configure. It uses new naming scheme that was introduced with PW 2.5.0 that supports suffixes. The complete image rendering is delegated to the core ImageSizer, or to any optional hooked in rendering engine. Template-settings are now fully supported, including removing variations when settings have changed. It fully respects settings for upscaling. If upscaling is set to false, you cannot select rectangles smaller than the crop setting. We implemented these enhancements: The GridView now is very nice and compact, and also benefits from the lately introduced setting for $config->adminThumbOptions. Permanent storage of the crop coordinates, quality and sharpening settings are now implemented native. No need to use PiM for this anymore. The usage/display of the Quality and Sharpening DropDown-Selects can be globally disabled/allowed in the modules Configpage. (additionally to that a setting on a 'per field base' is planned.) And the most wanted feature by the community: It gives back a pageimage and not the URL-string. This way you can use it like this: // get the first image instance of crop setting 'portrait' $image = $page->images->first()->getCrop('portrait'); You can further use every pageimage property like 'url', 'description', 'width' & 'height' with it: // get the first image instance of crop setting 'portrait' $image = $page->images->first()->getCrop('portrait'); echo "<img src='{$image->url}' alt='{$image->description}' />"; And you can proceed further image rendering with it: // get the first image instance of crop setting 'portrait' and proceed a resize with imagesizer $image = $page->images->first()->getCrop('portrait'); $thumb = $image->width(200); // or like this: $thumb = $page->images->first()->getCrop('portrait')->width(200); // and if you have installed Pia, you can use it here too: $thumb = $page->images->first()->getCrop('portrait')->crop("square=120"); The only downside with this is that when you (as the site developer) have enabled the usage of DropDown-Selects in the images editor, you do not know the values the editors have chosen for the images. As a workaround for this you can use the getCrop() method with a second param. This is a PW selector string. It can contain as many of the known pageimage options like 'quality', 'sharpening', 'cropping', etc, as you need, but none of them is required. But required is at least one setting for 'width' or 'height': $image = $page->images->first()->getCrop('portrait', "width=200"); $image = $page->images->first()->getCrop('portrait', "width=200, height=200, quality=80"); $image = $page->images->first()->getCrop('portrait', "height=400, sharpening=medium, quality=75"); . . You can get the module from GitHub: https://github.com/horst-n/CroppableImage (Better Docs are coming soon) Screenshots Related Infos A good setting in site/config.php for the AdminThumbs are: (height=>200 and scale=>0.5 !) $config->adminThumbOptions = array( 'width' => 0, 'height' => 200, 'scale' => 0.5, 'imageSizer' => array( 'upscaling' => false, 'cropping' => true, 'autoRotation' => true, 'sharpening' => 'soft', 'quality' => 90, 'suffix' => array(), ) );
    1 point
  10. Hi all, http://axisanimation.com http://axis-vfx.com http://flauntproductions.com I've added these to the directory but you might like to check some of the more interesting details written up in a blog post here - http://newnow.co/blog/the-4k-website/ They use: Modified multisite module to mix shared and site-specific content in one instance Modified thumbnail inputfield for cropping Custom inputfield to retrieve video details from Vimeo API Form builder module They are responsive from mobile to 4K, built on Zurb Foundation, and use the new picture element in conjunction with Processwire to serve images at the most appropriate size, and double size for higher pixel density displays. Wouldn't have been possible without the great forum content and documentation so thanks to everyone in the community! Crawford. New Now Ltd. http://newnow.co
    1 point
  11. Thanks for the pull request. If you have multi language support activated there is no label for the description field (but I want to have one) and I want to add some padding. So I check whether it's a multi language installation - but one line didn't make it into the right area. It's corrected Default: missing label and padding for description
    1 point
  12. You said you were having issues...what issues are those?
    1 point
  13. Thanks Pidelux, I will take a look at that on my next project. Regarding the static project, I think I've narrowed it down to using Middleman, Statamic or Grav. Statamic (or Kirby) looks useful in as much as it would have a very simplistic admin area if ever a client did want to get involved but they are both private, paid products unlike Middleman or Grav which are fully open source. At a push between Middleman and Grav I think I may go with Middleman as it seems to have a fair weight behind the people using it and it borrows quite heavily from Rails which I am comfortable with to a reasonable extent.
    1 point
  14. There is the module JSON Installer by Peter Beulque, which lets you add templates, fields and pages via JSON files. This may be very helpful for fast creation or reusing typical scenarios.
    1 point
  15. Good reads: https://processwire.com/talk/topic/2782-template-design-better-route/ https://processwire.com/talk/topic/740-a-different-way-of-using-templates-delegate-approach/
    1 point
  16. Or: $last = $pagearray->pop(); echo $pagearray->implode(', ','title') . ' & ' . $last->title;
    1 point
  17. Greetings, Just found this on Wired, and it is full of really fascinating ideas. It offers some perspective on where we have been, how much has changed, but also how much of what we use today was envisioned all the way back to CRT days of 1968! And what a coincidence that this computer sings the very same song that HAL 9000 sang in (also 1968) "2001: A Space Odyssey." Take a look: http://www.wired.com/2015/02/tech-time-warp-week-1968-computer-sings-daisy-bell/ Thanks, Matthew
    1 point
  18. Here's an article about it: http://www.smashingmagazine.com/2015/02/03/redefining-lazy-loading-with-lazy-load-xt/
    1 point
  19. Sorry, somehow I didn't link to the plugin above. Edited my post to add it. Anyway, the plugin I was talking about—and forgot to link to—, that is compatible with PF is Lazy load XT. See here about its use with responsive images https://github.com/ressio/lazy-load-xt#responsive-images
    1 point
  20. smile of my week....i like to share: http://saijogeorge.com/css-puns/ have fun mr-fan
    1 point
  21. I don't know if you can fix this, but currently it's hard to get the cropping box to the edges of the image, as the borders sometimes doesn't notice the drag end if you're releasing the mouse outside of the image. Top / right seem to work fine, but bottom and left edge don't get it for me. One can always drag the whole box down to the edge, but it would still be nice to have this working in all variations. Edit: @Ryan I can see that you don't want to duplicate stuff. But it would really be nice to have a single interface for editing image variations. This could even include variations generated by the api to be editable instead of just predefined sizes from CroppableModule and/or RTE images. Also now there are two seperate cropping UI's, which could each borrow a thought or two from each other, aside from the fact that just one interface would be easier for the user. Secondly editing api variations would even enable advanced stuff like using the picture element with automatic cropping for different imagesizes, while having the ability to author the crop for e. g. the mobile view afterwards, like showing a tighter crop. With CroppableImage this would only work for fixed aspect ratios.
    1 point
  22. Thanks from me as well. These lines in my template file plus adding alt to the img tags in the theme made my good friend the W3C validator happy. $options = array('title' => str_replace(' ', '%20', html_entity_decode($page->headline))); $soc = str_replace('&', '&', $modules->MarkupSocialShareButtons->render($options));
    1 point
  23. Well, I wanted to move some Repeater fields to PageTable. I couldn´t use your script because I wanted it to traverse a PageArray. So I totally rewrote your script, and added some comments. You can use as a template file for any page. Steps: Create a new Categories/Category Structure in PW: BothTemplates & Parent Page (Categories) and the new PageTable Field: categories. Assign the "new" PageTable Field to de templates where the Repeater is. The one we will migrate. Here: https://gist.github.com/biojazzard/654e9f00faacf419d952/ With love.
    1 point
  24. This is really rough, but I have tested it and it does work $p = $pages->get("/test/"); $rf = "repeater_test"; //repeater field name $ptf = "pagetabletest"; //pagetable field name $ptt = "basic-page"; //pagetable template name foreach($p->$rf as $r){ $npt = new Page(); $npt->of(false); $npt->template = $ptt; $npt->parent = $p; foreach($r->fields as $f){ $npt->$f = $r->$f; } $npt->save(); $p->of(false); $p->$ptf->add($npt); $p->save(); } The key thing is that for this to work as is, the repeater field must include a title field, because this is used to generate the names of the child pages for the pagetable entries. You could of course manually add a title field in the loop when creating the $npt page. EDIT: You can ignore the need for a title by making the title hidden and not required in the context of the pagetable template and setting a value for the automatic page name format when setting up the pagetable field. For this to work, the pagetable field must be already set up and ready to go. If I had more time today, I would have enhanced this a little more regarding the title/name issue, but hopefully it should get you going.
    1 point
  25. If PW is paginating any other $pages->find() / $page->children() calls that you don't want it to, add a "start=0" to your selector, for the calls you don't want it to paginate.
    1 point
×
×
  • Create New...