Copied to clipboard

Flag this post as spam?

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


  • Harm-Jan Abbing 62 posts 102 karma points
    Mar 31, 2010 @ 11:51
    Harm-Jan Abbing
    0

    currentpage level problem

    Hi all,

    My first post here!

    (umbraco v 4.0.3)

    I'm having some trouble getting the right level for a random image xslt.

    I have a simple top navigation with a level 1 "home" and all other links level 2. The masterpage has a macro for setting a random image banner which i currently reduced to just writing the $currentPage/@level. Annoyingly, it shows level 3 on half the pages while they are obviously level 2. These pages are all direct childnodes of homepage and i checked the umbraco.config to make sure their level attribute was 2.

    I feel like i am missing something obvious.

    All answers are much appreciated!

    Kind regards,
    Harm-Jan

  • Daniel Horn 319 posts 344 karma points
    Mar 31, 2010 @ 11:59
  • Harm-Jan Abbing 62 posts 102 karma points
    Mar 31, 2010 @ 13:35
    Harm-Jan Abbing
    0

    I read the page but i can't find the solution yet.

    I think my understanding of nodes and xpath is allright, but maybe i'm just not seeing something here.

    When writing the pageName i get the correct name, but the level is wrong.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 31, 2010 @ 14:35
    Jan Skovgaard
    0

    Hi Harm-Jan

    Could you maybe show us an example of your XSLT code?

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Mar 31, 2010 @ 22:07
    Chriztian Steinmeier
    0

    Hi Harm-Jan,

    If you're indeed writing just $currentPage/@level out to the page and it comes out as "3" for nodes you know to be at level 2, then you're data is corrupt or out of sync in some way. To double check either use the XML Dump package to check the actual XML (i.e. not the disk version in umbraco.config) OR write the entire $currentPage XML in a <textarea> or <xmp> tag on the page, to check the level attributes.

    /Chriztian

  • Harm-Jan Abbing 62 posts 102 karma points
    Apr 01, 2010 @ 09:58
    Harm-Jan Abbing
    0

    Thanks Chriztian!

    By using your method of writing the raw currentpage xml to a textarea i found out those pages were indeed level 3.

    When copying the pages for backup we discovered there was a redirect set to the pages themselves, deleting that redirect fixed it. No idea how it got set though. Hm, the client has access..

    Thanks again for your help.

Please Sign in or register to post replies

Write your reply to:

Draft