Jump to content

fenton

Members
  • Posts

    98
  • Joined

  • Last visited

Everything posted by fenton

  1. adrian - you are right! thanks Quick glance - do you need to have: $first_page = $siblings->first()->id that was the problem
  2. thanks a lot guys! true the problem is, that I have to traverse folders, since my structure is like this: News - 2013 -- 05 --- article 06 --- article 05 --- article 04 --- article 03 --- article 02 -- 06 --- article 01 still wondering though, why from my example above: if ($pageID == $last_page) { echo "<a href='$prev->url'>prev</a>"; } doesn't work, even though if I echo both variables the value is the same: 1060 1060 cheers, j
  3. thank you guys! will go through your suggestions and report back
  4. Hi there, I feel stupid for asking this I'm trying to loop through folders with pages that have the template "articles" and want to display "prev I next" buttons, but don't want to display the pipe symbol on the first ot last post. I had it working with the explode version (uncommented code), but it doesn't work if I do it the right way with the PageArray. I'm referring to this post: http://processwire.com/talk/topic/3865-image-tags/?p=37806 <?php $siblings = $pages->find("template=article"); $next = $siblings->getNext($page); $prev = $siblings->getPrev($page); /* $pageID = $page->id; $siblings_array = explode("|", $siblings); $first_page = reset($siblings_array); $last_page = end($siblings_array); if ($pageID == $last_page) { echo "<a href='$prev->url'>prev</a>"; } elseif ($pageID == $first_page) { echo "<a href='$next->url'>next</a>"; } else { echo "<a href='$next->url'>next</a> | <a href='$prev->url'>prev</a>"; } */ $pageID = $page->id; $first_page = $siblings->first(); $last_page = $siblings->last(); if ($pageID == $last_page) { echo "<a href='$prev->url'>prev</a>"; } elseif ($pageID == $first_page) { echo "<a href='$next->url'>next</a>"; } else { echo "<a href='$next->url'>next</a> | <a href='$prev->url'>prev</a>"; } ?> any ideas what I'm doing wrong? thanks a lot, j
  5. thanks Soma! I was doing the same mistake *explode*
  6. did you check this out? http://processwire.com/talk/topic/2468-module-processdatearchiver/ it's really nice, well done & handy
  7. hey kongondo, thanks, that looks good! maybe I'm overthinking scenarios e.g. that end users might get confused between creating pages in the tree, then browsing/editing them with Somas module (which works great btw.) cheers, j
  8. Hi there, I know this has been discussed before, I just got some further questions let's say I have a news section where my news items get stored in year/month/day-folders automatically using 'processdatearchiver' (http://processwire.com/talk/topic/2468-module-processdatearchiver/) is there another module besides Somas 'Datatable' (http://processwire.com/talk/topic/704-datatable/) to add, edit, delete posts in a chronological listing? thought I saw another post awhile ago, but am not sure ... cheers, j
  9. okay, got it "URL Segments" was enabled for that template kongondo, thanks for posting the solution *almost finished my first Processwire site*
  10. hey kongondo, thanks a lot! oddly enough this doesn't work for me ...will keep on trying & report back j
  11. Hi Soma, first of all, thanks for this great module! I get the following message displayed: Notice: Undefined offset: 1 in C:\[...]\site\modules\MarkupSimpleNavigation.module on line 217 and this is one of my calls: <?php $treeMenu = $modules->get("MarkupSimpleNavigation"); // load the module $rootPage = $page->parents->count == 1 ? $page : $page->parent; $options = array( 'parent_class' => 'active', 'current_class' => 'active', 'max_levels' => 1, 'outer_tpl' => '' ); echo $treeMenu->render($options, null, $rootPage); ?> any ideas what might cause this, or can I ignore the message? cheers, j
  12. Hi there, I know, it's probably a really stupid question, but how can I define which page will be shown as 404? I checked and compared a vanilla PW installation, but can't find out why on the site I'm working on all non existant URLs redirect to the homepage thanks a lot, cheers, j
  13. hey kongondo, absolutely! (...although it's only a tiny gallery made with repeater fields)
  14. thanks Soma! but in that case a portrait image would have the desired width, but exceed the max-width of 320px. Ideally, in that case, the max-height of 320px should be taken into account) (currently trying to port a modx MaxiGallery to processwire)
  15. Hi there, is there a way to change the way images are named (with the size extension) while being uploaded e.g. dsc02395.jpg will become dsc02395.450x320.jpg. would it be possible to generate something like 450x320_dsc02395.jpg or large_dsc02395.jpg etc? thanks & cheers, j
  16. Hi there, is there a way to set a max-width + max-height setting for images on upload and keep the aspect ratio? e.g. a landscape format picture shouldnd't be wider that 450px, as well as not exceed 320px in height and a portrait format image shouldn't be higer than 320px currently image->size(450,320,$options) will always produce an image 450px wide and 320px high even when it's a portrait format image is is this somehow possible? thanks a lot, cheers, j
  17. thanks Ryan! will try it out and report back *edit: yes, it works
  18. Hi Soma, function segmentUrl(HookEvent $event){ $url = $event->return; // requested url $segment = "/about/"; if(strpos($url,$segment) == 0){ $event->return = str_replace(rtrim($segment,'/'),'',$url); } } $wire->addHookAfter('page::path', null, 'segmentUrl'); is this a working example? I tried placing it in my template (url segments are enabled) and changed the segment part to the one I want to strip from my url cheers & thanks, j
  19. hey Marc! thanks oh, of course, I'm an idiot (no sleep).
  20. hi everyone, is there a way to only allow 1 image per repeater field (repeater with input type image) to be uploaded. I guess it could be confusing for an user to have the option to upload several pictures for the same repeater item: thanks a lot, cheers, j
×
×
  • Create New...