Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • trfletch 598 posts 604 karma points
    Apr 15, 2009 @ 18:58
    trfletch
    0

    Next and previous links to Pages/nodes on same level

    Hi,

    In my Umbraco 4 site I have the following structure:

    Sub section
    - Sub page A
    - Sub page B

    Sub section
    - Sub page C
    - Sub page D

    On the sub pages I want to have links at the bottom that look like this, say for example if I am on Sub page B I want to see the following at the bottom of the page:

    <<Previous Sub Page A space Sub Page C Next >>

    Previous and Next will be links that take you to the pages and the page names will just be labels. Is this possible and if so what would the XSLT look like. Many thanks.

  • Petr Snobelt 923 posts 1535 karma points
    Apr 16, 2009 @ 08:09
    Petr Snobelt
    0

    Take a look here
    http://www.nibble.be/?p=44

    Petr

  • trfletch 598 posts 604 karma points
    Apr 16, 2009 @ 10:23
    trfletch
    0

    Hi Petr,

    Thanks for the response, I have used your code as follows:

    [code]
    [/code]

    But this does not allow me to jump between the sub sections it just shows links to the ones in the same sub section. Also I need a way to exclude pages that don't have a true/false checkbox checked. Any idea's as to how I could acheive this? Many thanks

  • trfletch 598 posts 604 karma points
    Apr 16, 2009 @ 12:33
    trfletch
    0

    Anyone got any suggestions on this? I'm more interested in making it so that it only shows a link to pages that have a true/false checkbox checked. I can live without the showing nodes in other sub sections for now.

  • Petr Snobelt 923 posts 1535 karma points
    Apr 16, 2009 @ 22:30
    Petr Snobelt
    0

    If you want showing nodes from others sections tim's code will be easyer to modify.

    And for checkbox simply add condition [string(data [@alias='umbracoNaviHide']) != '1']
    like this

  • Jesper Hauge 298 posts 487 karma points c-trib
    Apr 17, 2009 @ 00:37
    Jesper Hauge
    0

    Haven't tested this but according to xpath specs, you should be able to do something like this:

    [code]


    select="$currentPage/preceding::node[@level=$currentPage/@level][last()]" />

    select="$currentPage/following::node[@level=$currentPage/@level][1]" />


    [/code]

    Regards
    Jesper Hauge[size=6][/size]

  • trfletch 598 posts 604 karma points
    Apr 17, 2009 @ 10:22
    trfletch
    0

    I did try Tim's code but it kept throwing up an error about $itemindex when I tried to save it.

    Thanks jhauge, I tried the code you specified, it does work until you get onto the last node then it throws up an XSLT error.

  • Jesper Hauge 298 posts 487 karma points c-trib
    Apr 17, 2009 @ 12:33
    Jesper Hauge
    0

    Again haven't tested this, but you probably need to check if previous and next node actually exists before trying to render the values of the nodes

    How about this:

    [code]



    [/code]

    .Hauge

  • trfletch 598 posts 604 karma points
    Apr 17, 2009 @ 13:27
    trfletch
    0

    Ok the next part of that one works fine (it gets to the end and doesn't throw an error) but the previous part always shows a link to the first node rather than the one that precedes the current node. Also I need to work out how to get it to check if the true/false checkbox is checked, so hopefully I could incorporate what petr suggested somehow?

  • Petr Snobelt 923 posts 1535 karma points
    Apr 17, 2009 @ 15:05
    Petr Snobelt
    0

    [code]


    [/code]

    Doesn't work?

  • trfletch 598 posts 604 karma points
    Apr 17, 2009 @ 15:16
    trfletch
    0

    Hi Petr,

    Your code does work to a certain extent, if I check the true/false box then it makes that page show up on the "previous-next" link but if I am then to uncheck the box then that page stays on the "previous-next" link rather than getting removed (almost as if it is caching the fact that the checkbox was previously checked).

    Also the code doesn't show pages in other sub sections on the current section, I can live without this though if it is not possible. Many thanks

  • Petr Snobelt 923 posts 1535 karma points
    Apr 17, 2009 @ 17:08
    Petr Snobelt
    0

    It looks like isch checkbox related problem. My code is for standard yes/no radiobutton (in fact i don't use it much, but it should be :-)
    try test (debug) umbracoNaviHide and modify condition if necessery.

    Petr

  • trfletch 598 posts 604 karma points
    Apr 17, 2009 @ 17:44
    trfletch
    0

    Sorry you've completely lost me, maybe its because its Friday! What is "isch checkbox related problem" and what is "test (debug) etc etc" and how do I implement it?

  • trfletch 598 posts 604 karma points
    Apr 20, 2009 @ 15:41
    trfletch
    0

    Any other suggestions on how to get this to work?

  • trfletch 598 posts 604 karma points
    Apr 23, 2009 @ 12:12
    trfletch
    0

    Hi again,

    Is there anyone out there that can help with this one? I thought we almost seemed to get there then thing went quiet. Basically I want a Previous and Next navigation that takes me through pages they have a true/false checkbox checked. These pages are in different subfolders but maybe the XSLT could just search all the pages in the site that have the checkbox checked or is this not recommended?? I appreciate any advice anyone can offer.

  • Petr Snobelt 923 posts 1535 karma points
    Apr 24, 2009 @ 14:53
    Petr Snobelt
    0

    HI,
    try start with check property value of your checkbox



    And you see what is in your umbracoNaviHide property.

    Then you can modify condition in xslt if

    Petr

  • trfletch 598 posts 604 karma points
    Apr 29, 2009 @ 10:05
    trfletch
    0

    Hi Petr,

    Thanks for the response, I had pretty much given up on this thread and didn't receive an email notification from it so it was only by chance that I noticed your reply.

    I tried the code below and once again it seems to show next and previous links to nodes that did at one time had the checkbox checked even though it is no longer checked. It only shows nodes in the same sub folder.

  • Petr Snobelt 923 posts 1535 karma points
    Apr 30, 2009 @ 09:45
    Petr Snobelt
    0

    Ok,
    lets try see what value(s) are in your property


  • trfletch 598 posts 604 karma points
    Apr 30, 2009 @ 11:26
    trfletch
    0

    Hi Petr,

    Sorry maybe I'm being a bit stupid but I'm not sure where I should add that code and what it is trying to acheive? Do I add it to the XSLT I already have or add it instead of it? Thanks for the help

  • Petr Snobelt 923 posts 1535 karma points
    May 06, 2009 @ 09:51
    Petr Snobelt
    0

    Hi it dosn't metter, you can add it before previous xslt, it only shows all nodes and it's property value. Maybe we can then modify condition of previous xslt to work

Please Sign in or register to post replies

Write your reply to:

Draft