Jump to content


  • Posts

  • Joined

  • Last visited

Posts posted by fenton

  1. thanks a lot guys!

    But it sinks in better if you make faults.

    true :)

    PW already has $page->next(); and $page->prev(); Can't those be used in this case?

    the problem is, that I have to traverse folders, since my structure is like this:


    - 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

  2. 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

                $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

  3. 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

  4. 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:

                $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

  5. 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

  6. 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

  7. 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

  8. 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

  9. 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...