Copied to clipboard

Flag this post as spam?

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


  • w0lf 2 posts 32 karma points
    Aug 09, 2009 @ 16:39
    w0lf
    0

    Using Runway DropDownNavigation with other pages

    Hi, guys!

    I'm new to Umbraco and I'm trying to build a website.

    I have performed the following steps:

    1. Installed the Runway foundation + DropDownNavigation macro

    2. Created a different structure of Master pages, beside Runway's

    3. Created a new structure of pages based on my master pages

    4. In my top master page I have included the 

    <umbraco:Macro Alias="RunwayDropdownNavigation" runat="server" />

    snippet and now it correctly outputs the structure of my pages using ul/li html tags.

     

    The problem is that the scripts/css/inline javascript needed by the DropDownNavigation macro are not included in my pages for some reason, so it just looks like a static menu with only the top level pages.

    I have checked the RunwayDropdownNavigation.xslt file, and saw that it contains the following lines:

    <xsl:value-of select="umbraco.library:AddJquery()"/>
    <xsl:value-of select="umbraco.library:RegisterJavaScriptFile('droppyJs', '/scripts/droppy.js')"/>
    <xsl:value-of select="umbraco.library:RegisterStyleSheetFile('droppyCss', '/css/dropdownnavigation.css')"/>
    <xsl:variable name="droppyJS">$(function() {$('#dropdownNavigation').droppy();});</xsl:variable>

    I figured this means that running the XSLT module will automatically add all needed css/script declaration and the inline javascript function call into the HTML document.

    In the Runway pages it does work; the above elements are included in the HTML and the navigation works fine.

    In my pages it doesn't.

     

    Any idea why that might be?

    Thank you in advance.

  • Chris Koiak 700 posts 2626 karma points
    Aug 09, 2009 @ 17:47
    Chris Koiak
    100

    Welcome to the forum and Umbraco.

    Check if you <head> tag has a runat="server" attribute.

    If it does, check if the rendered html includes the js references but they may be returning 404.

  • w0lf 2 posts 32 karma points
    Aug 09, 2009 @ 17:54
    w0lf
    0

    Chris,

    Thank you very much for your quick response.

    My problem was the missing runat attribute on the head tag. :)

  • Jesper Ordrup 1019 posts 1528 karma points MVP
    Oct 06, 2009 @ 10:17
    Jesper Ordrup
    0

    Another related thing .. if you remove the <form runat="server"> tag the dropdown navigation stops working. The reason for this is that in "dropdownnavigation.xslt" the following line requires the form tag.

    <xsl:value-of select="umbraco.library:RegisterClientScriptBlock('droppyJs', $droppyJS, true())"/>

    I usually don't wan't the <form runat="server"/> tag on each and every page so if yo're like me and want to remove it, you need to put the initialization elsewhere. Add you own .js file to the master template and enter the following statement:

    $(function() {$('#dropdownNavigation').droppy();});

    /Jesper

Please Sign in or register to post replies

Write your reply to:

Draft