Jump to content

Peter Knight

Members
  • Posts

    1,379
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Peter Knight

  1. Working on a site at the moment with lots of PDF downloads and was wondering how you handle these? In my ProcessWire projects so far, each PDF has generally be restricted to a single page. I normally create a field called Files and reference that in any CK Editor links. The problem I realised is that when one of these PDFs needs replacing, my client needs to remember every page where the PDF is referenced. With this site I'm currently building, I have multiple pages referencing the same PDF(s). In the CK Editor modal for linking files, I can of course choose a different page where the file "lives". I'm starting to wonder though if I should create a virtual Files directory which would simply be a container page with each sub-page representing and named after a file. This way, when my editors need to replace a file, they just need to replace and update in a single location. Any known cons of doing it this way?
  2. Confirmed - this is an "issue" with PTExtended. On PT, the icon is once you hover over the row. Mine wasn't displaying as the field was caching some PTE settings.
  3. Finally got round to trying PageTable tonight and really liking it so far. A tiny thing I notice is that although the rows are sortable, there's no Sort Handle icon at the beginning of each row. Is this an error in my setup or simply how things are right now? For example, here's a Repeater field with multiple, sortable rows. Notice the drag icon. And here's an example of a PageTable rows (no icon)
  4. Hey @TDH Did you get sorted for your image problem?
  5. Guys - you're right. Problem at my end with my list items and formatting didn't help.
  6. @Soma Have you plans for an active/here class? It's different than the current class as it's applied to the parent list items In MODX Wayfinder, this was called the &hereClass &hereClass CSS class for the items showing where you are, all the way up the chain. CSS = .active So if I was currently on a page called Pluto below, the active classes would be applied as follows... Nature Geography Astronomy (active) - Solar Systems - Planets (active) - - Mars - - Pluto (current) - - Venus - Black Holes
  7. Is your image field exactly named my_imagefield ? And is your image field limited to a single image?
  8. I eventually built my own. Actually, Kongondo helped me somewhat. All I needed was posts tags categories comments As I needed much finer control over the markup and templates, it was straightforward to build these natively with PW using regular pages and the Page select fields etc. Is that an option for you?
  9. @Soma That's what I needed. I hadn't tried those two in conjunction with each other.
  10. Good luck with it. In my experience, companies like this tend to make decisions on whats currently available, what fits around their process and whats least likely to disrupt their complex workflows. And rightly so but maybe you could flag that sometime before the end of the year that this functionality will be available.
  11. Hey Mr-fan That occurred to me (pages as single images) and would have a few benefits in this project. I might even go down that route as the portfolio grows. Was thinking too that I could use Lister pro then as a kind of Images manager. Kind like what Soma is doing with his setup. Otherwise, I was just putting it out there that it's be a nice idea? Probably not easy or quick to refactor in terms of the core but would be a nice addition.
  12. Short version Can we make the Page fieldtype as the tagging engine for images? Long version / real example I started using image tags for the first time after reading making efficient use of fields in PW. There's a part titled Use multi-file fields to replace several single-file fields where Ryan mentions tagging. As I was building a site for an interior designer, I needed an almost identical setup and to tag images with a gallery with "basement", "living room", "garden" and "kitchen" tags. At one stage, my client wanted "basement" changed to "basement and garden" and I had to manually edit about 15 images. No big deal really but it doesn't seem very scalable. Having used the Page fieldtype for tagging blog posts and news and experienced how easy it is to make global tag names changes etc, I wondered if the Page fieldtype could be put on the roadmap as the tagging engine for images or at least as an option.
  13. @Pete Just wondering if there was a reason that a members previous posts are capped at X months? IE if you visit your profile and search for Posts or Topics, there's not a complete archive. is this to save CPU and database resources?
  14. I'm due a trip to London this summer. Nothing set yet but I'd love too to meet other PW users and have a beer.
  15. I'm late getting back to this Just to recap, I have a side navigation bar. For the purposes of explanation, if it was completely expanded (which it never is), it would look like this ProductsRockets Spacecraft Submarines StaffEngineering TeamAlan John Miriam Ballistics TeamPhil Tracey Liam Strategy & Planning TeamPeter Adrian Mary LocationsMoonStation Lunar Station Solar EarthUSA Germany Ireland France England The menu correctly displays as Products Staff Location with ​'max_levels' => 1 However if I was to send someone a direct link to a level 3 page ( Staff > Ballistics Team > Tracey) then I want the side menu to display that page, all level 3 siblings (Phil, Tracey and Liam), it's level 2 root pages and it's level 1 parent(s) Products StaffEngineering Team Ballistics TeamPhil Tracey Liam Strategy & Planning Team Locations As mentioned by mar-fan there has since been options added for selector_leveln properties but I'm not sure if thats what I need? added support for nav_selector property/field and selector_leveln (new in 1.2.1) Here's my working menu which has ​'max_levels' => 1 <?php $treeMenu = $modules->get("MarkupSimpleNavigation"); // load the module $options = array( 'parent_class' => 'parent', 'current_class' => 'current', 'has_children_class' => 'has_children', 'levels' => true, 'levels_prefix' => 'level-', 'max_levels' => 1, 'firstlast' => true, 'collapsed' => false, 'show_root' => true, 'selector' => '', 'selector_field' => 'nav_selector', 'outer_tpl' => '<ul class="sidelist">||</ul>', 'inner_tpl' => '<ul>||</ul>', 'list_tpl' => '<li%s >||</li>', 'list_field_class' => '', 'item_tpl' => '<a href="{url}">{title}</a>', 'item_current_tpl' => '<a href="{url}" >{title}</a>', 'xtemplates' => '', 'xitem_tpl' => '<a href="{url}">{title}</a>', 'xitem_current_tpl' => '<span>{title}</span>', 'date_format' => 'Y/m/d', 'code_formatting' => false, 'debug' => false ); $root = $page->rootParent; // Start from the top root parent of current page echo $treeMenu->render($options, null, $root); ?> Thanks guys.
  16. I know this is an old thread but I needed a back and next link for a template and the solution here was great. I know it's not very process-wirey but I just hide the previous and next link if there is no previous and next page. <nav> <ul id="prev-next"> <li> <a class="<?=$page->prev->id ? 'previous' : 'no-before'?>" href="<?php echo $page->prev->path; ?>"> <strong><</strong> <?=$page->prev->title?> </a> </li> <li> <a class="<?=$page->next->id ? 'next' : 'no-after'?>" href="<?php echo $page->next->path; ?>"> <?=$page->next->title?> <strong>></strong> </a> </li> </ul> </nav> and then ul#prev-next { margin:0; } #prev-next li{ display:inline; list-style:none; } #prev-next a.no-after { display: none; } #prev-next a.no-before { display: none; } #prev-next a.previous { margin-right: 1rem; }
  17. Yippe Thanks guys. And thanks for the explanation too
  18. Hi guys Managed to get a complex (to me anyway) image count and if/else echo going. <?php // if Background_Image contains more than 1 echo those images in a slideshow if($page->Background_Image->count > 1 ){ $bgimage = $page->Background_Image; foreach ($bgimage as $image) { echo" <script> $.backstretch('$image->url'); </script> ";} } else // otherwise echo a single image on its own if($page->Background_Image->count == 1 ){ $bgimage = $page->Background_Image; foreach ($bgimage as $image) { echo" <script> $.backstretch(['$image->url',], {duration: 3000, fade: 750}); </script> ";} } ?> I'm not sure how to handle the last part of the echo though. The Script I'm using says that an image slideshow should be outputted in following format $.backstretch([ "http://dl.dropbox.com/u/515046/www/outside.jpg" , "http://dl.dropbox.com/u/515046/www/garfield-interior.jpg" , "http://dl.dropbox.com/u/515046/www/cheers.jpg" ], {duration: 3000, fade: 750}); IE each image needs a comma but the last image should have no comma then a square bracket and then the remainder. With my code, I'm currently getting three separate <script> $.backstretch('/site/assets/files/1/016---dc3420.jpg'); </script> <script> $.backstretch('/site/assets/files/1/021---dc3420.jpg'); </script> <script> $.backstretch('/site/assets/files/1/photo-bathroom.jpeg'); </script> instead of the desired structure
  19. Thanks guys. Ran into a slight problem on my end whereby some of the before and after sequences have a before, during and after photo :-/ Which means I'll have to tweak this a bit. I think I'll go live with the site tomorrow as planned and then on Saturday, try your samples.
  20. Guys - sorry to come back with this but my setup has changed, The following works on a single image field called Images. It echoes a series of thumbs tagged 'before and opens a modal popup containing 2 images each tagged 'before' and 'after'. <?php foreach($page->Images->findTag('after') as $image) { $thumb = $image->size(300,300); // thumb is the 300 x 300 thumbnail outputter initially $before= $page->Images->getTag('before'); //before is the image tagged 'before' $after= $page->Images->getTag('after'); //after is the image tagged after echo " <a class='fb-beforeafter port-item {$image->tags}' href='#inline1'> <img src='$thumb->url' class='portfolio-thumb'> </a> "; echo " <div id='inline1' style='display: none;'> <div class='container1' class='twentytwenty-container'> <img src='{$before->url}'> <img src='{$after->url}'> </div> </div> "; } ?> I'm not sure what I need to do if this needs to work instead on a Images field wrapped in a repeater called before_after Any advice gratefully accepted. Going live tomorrow (eek!)
  21. Guys - I feel the same. PW has largely such a consistently brilliant interface that anything even slightly off is amplified. At the same time, the image crop modules are essential. If any core-contributors or module-makers want to team up and move this along, please shout.
  22. Thanks for the feedback Ryan. Lots of stuff raised that I hadn't thought of. I was thinking that there was some kind of integration actually. IE If CroppableImage was installed and you had certain Crop-tions set, the Croptions part of the UI would display. If you don't have CroppableImage installed then you don't see 'em. That way I also imagined that future image Modules could selectively plug in to the modal. Then, the more basic 1:1 3:2 and 4:3 were just pre-defined, standard and non CroppableImage out-of-the-box ratios. Anyway, really good to hear from you as I realise there's a ton of complexity and considerations underlying some simple mockups.
  23. Cheers Nico. Just graphics at the moment. I've some refinements on the way.
  24. When you guys refer to a field setup having too much overhead, do you mean it's too heavy on the database or complicates the Admin?
×
×
  • Create New...