Copied to clipboard

Flag this post as spam?

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


  • Kyle Skrinak 272 posts 327 karma points
    Feb 18, 2011 @ 12:18
    Kyle Skrinak
    0

    RunwayNavigation XSLT and specifying the correct parent or root node

    On: Umbraco 4.6.1

    Context: Content view:

    Content
    > Home
       > [ 2 -tier content ]
    > Blog
       > [ using blogs4umbraco structure ]

    I am using a modified RunwayNavigation XSLT that works great from the "Home" node. However, I'd like to use the same XSLT from within the "Blog" peer node. The RN XSLT dutifully runs out the nav structure of "Blog" but I want the Home section pages output there.

    I'm sure this is simple, but how do I tell it to point to "Home" and not "Blog" ?

    Thanks!

  • Kyle Skrinak 272 posts 327 karma points
    Feb 18, 2011 @ 19:53
    Kyle Skrinak
    0

    Alright, my taciturn friends, maybe this helps? The Runway Navigation XSLT is using this variable:

     

    <xsl:param name="parent"/>

    Which, I'm guessing, determines the "start" point for the node/navigation traversal/recursion. If I could set that to, say "1056" (the id of my home node) but I'm flummoxed on where to start?
    Thanks!
    Here is the full xslt:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [
    <!ENTITY nbsp "&#x00A0;">
    ]>
    <xsl:stylesheet
      version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:umbraco.library="urn:umbraco.library" exclude-result-prefixes="msxml umbraco.library">
      <xsl:output method="xml" omit-xml-declaration="yes"/>
      <xsl:param name="currentPage"/>
      <!-- update this variable on how deep your navigation should be -->
      <xsl:variable name="maxLevel" select="3"/>
      <xsl:template match="/">
        <xsl:value-of select="umbraco.library:RegisterJavaScriptFile('equalHeights', '/scripts/jquery.equalheights.js')"/>
        <!-- <xsl:value-of select="umbraco.library:RegisterJavaScriptFile('droppyJs', '/scripts/droppy.js')"/>
        <xsl:variable name="droppyJS">$(function() {$('#dropdownNavigation').droppy();});</xsl:variable>
        <xsl:value-of select="umbraco.library:RegisterClientScriptBlock('droppyJs', $droppyJS, true())"/>-->
      <ul id="dropdownNavigation">
        <xsl:call-template name="drawNodes">
          <xsl:with-param name="parent" select="$currentPage/ancestor-or-self::* [@level=1 and @isDoc]"/>
        </xsl:call-template>
      </ul>
    </xsl:template>
    <xsl:template name="drawNodes">
      <xsl:param name="parent"/>
      <xsl:if test="umbraco.library:IsProtected($parent/@id, $parent/@path) = 0 or (umbraco.library:IsProtected($parent/@id, $parent/@path) = 1 and umbraco.library:IsLoggedOn() = 1)">
        
        <xsl:for-each select="$parent/* [@isDoc and string(umbracoNaviHide) != '1' and @level &lt;= $maxLevel]">
          <li>
      <a href="{umbraco.library:NiceUrl(@id)}">
        <xsl:value-of select="@nodeName"/>
      </a>
      <xsl:if test="count(./* [@isDoc and string(umbracoNaviHide) != '1' and @level &lt;= $maxLevel]) &gt; 0">
        <ul>
          <xsl:call-template name="drawNodes">
            <xsl:with-param name="parent" select="."/>
          </xsl:call-template>
        </ul>
      </xsl:if>
          </li>
        </xsl:for-each>
      </xsl:if>
    </xsl:template>
    </xsl:stylesheet>

     

  • Kim Andersen 1447 posts 2197 karma points MVP
    Feb 18, 2011 @ 21:16
    Kim Andersen
    0

    Hi Kyle

    You want the Blog node to be a part of the main navigation or what do you want? Or you just want a link to the Home node in the navigation of the Blog nodes? I don't think I quite undestand what you're trying to achieve.

    /Kim A

  • Kyle Skrinak 272 posts 327 karma points
    Feb 18, 2011 @ 21:35
    Kyle Skrinak
    0

    Kim,

    Thanks for asking.

    All children nodes of "Home" that run the runway nav XSLT produce, say:

    Home:
    -->Product
    ----->Widgets
    ----->Wadgets
    ----->Wonkgets
    -->Services
    ----->Widget Enhancement
    ----->Widget Retirement
    ----->Widget Removal
    -->Testimonials
    ----->Joe Smith
    ----->tallulah bankhead

    I want this same navigational output from within the "Blog" section, the sibiling of "Home" That is to say, that it's not using the top-most node, i.e., "Blog" to render the menu.

    Does that make sense?

  • Kim Andersen 1447 posts 2197 karma points MVP
    Feb 18, 2011 @ 22:11
    Kim Andersen
    0

    Can't you just put the Blog node under the Home node? This would create the same menu as if you where standing on the Testimonials-node, the Product node or whatever.

    /Kim A

  • Kyle Skrinak 272 posts 327 karma points
    Feb 18, 2011 @ 22:26
    Kyle Skrinak
    0

    Yea, I know. Yesterday, I was getting an error when I tried to move my blog parent node. Today, I'm not. Blog is now a direct descendent of "Home" with the boolean to be hidden from the main nav. Yea, that solves my problem. Much thanks!

  • Kim Andersen 1447 posts 2197 karma points MVP
    Feb 19, 2011 @ 14:27
    Kim Andersen
    0

    Great to hear Kyle.

    If you insisted to keep the structure the other way we could have solved the issue as well, but moving the Blog node sounds like a much better solution in my ears :)

    /Kim A

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies