Copied to clipboard

Flag this post as spam?

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


  • Mike 81 posts 101 karma points
    Dec 30, 2011 @ 21:10
    Mike
    0

    I need some serious help with a couple navigation things...

    Here is my dev url.. perkinsperformance.inbounddesigns.com. Here is the live URL where I am using a different technology to make it all work.

    I need help with getting the nav to skip over the logo in the middle..Also I need serious help with getting it to do more than one level in the top and a tree view type structure in the subnav.

    I need help with the products navigation. I need it to show Just the galleries I created under Ford. etc for each link and I am not sure how to do this...

    I have it as

    Products

    Ford

    Chevy

    Etc

    Maybe pay someone to get me out of these binds? I have put in way too much time already and I may need to scrap using this product. I would rather understand it as I see how powerful it is but my current scope of expertise in this is killing my rep with the client...

     

    Thanks!

  • Mike 81 posts 101 karma points
    Dec 30, 2011 @ 21:12
    Mike
    0

    I am getting an xslt error when I try to edit my post. The url to the live site is perkinsperformance.com. Also maybe I could hard code a little css nav and if someone could help me with the xslt to mimic it?

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Dec 30, 2011 @ 21:59
    Tom Fulton
    0

    Hi Mike,

    I'm unsure how when you want to determine to skip over the nav, maybe after 3 LI's?

    If so you could just add a check for position() = 3 in your loop, ex below, and remove your "blank" node.

    <xsl:for-each select="......">
    ....
    ....
      <xsl:if test="position() = 3"> <!-- After we write the 3rd li, write out the "placeholder" LI -->
        <li style="width:370px;" class="rmItem  topnav_logo"><a style="background-image:url();" class="rmLink rmRootLink rmDisabled rmDisabled topnav_logo"><span class="rmText"></span></a></li>
      </xsl:if>
    </xsl:for-each>

    With the Products menu I'm a little unclear on what you are doing - are you referring to the dropdown on the top menu or the left menu on the Products page?  Thinking you mean the left menu on the Products page and you want to add sub items to each main link?  Check out the Sitemap.xslt template for a good example or let us know if you still need help.

    Also in the future you can always use Razor instead of XSLT if you are more comforatable with that :)

    -Tom

  • Mike 81 posts 101 karma points
    Dec 30, 2011 @ 22:32
    Mike
    0

    Thanks Tom, I will give it a shot!!! I named the particular nav item "Blank"... Is there an easy way to determine if it's blank and do the same if statement? But I think that for sure it will solve the spacing issue!!!

    As for the top nav menu, I tried the following xslt to create the new set of dropdowns or flyouts if you will to mimic it on perkinsperformance.com

    <xsl:for-each select="$currentPage/ancestor-or-self::* [@level=3]/* [@isDoc and string(umbracoNaviHide) != '1']">

                   <ul>
        <li>WE HAVE A 3rd LEVEL</li>
       </ul>
               </xsl:for-each>

    Then for the left nav on this page - http://perkinsperformance.inbounddesigns.com/products.aspx

    it shows all image galleries. Ford front bumper Ford rear bumper etc. So I when I click on "Ford" in the left nav I want it to show just those items. Also I would like the left nav to look like this.

    Ford

       Front Bumpers

       Rear Bumpers

       Etc

    Chevy

       Front Bumpers

       Etc

    I tried the same xslt as above for this as well and other stuff but could not get it to work....

    I used to be a really good xslt developer about 5 years ago but I haven't used it and really a beginner again. I have no idea anything about razor or what it's all about.

    I will take a look at that sitemap.xslt file. I want to build that out anyways for SEO....

  • Mike 81 posts 101 karma points
    Dec 30, 2011 @ 23:34
    Mike
    0

    Hey Tom, your xslt was perfect!!! Thanks! Gave you a big High 5!

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Dec 31, 2011 @ 03:53
    Tom Fulton
    0

    Hey Mike, glad it worked.  To answer your questions further:

    Yes, you could also test for the name like so:

    <!-- inside your for each loop -->
    <xsl:if test="./@nodeName = 'Blank'">
    <!-- write your placeholder -->
    </xsl:if>

    For the top nav you'll need to add an additional check in your for each loop, to see if the node has any children and write out a new UL if so.  I think some of the built in templates should have examples of this, but the gist is:

    <xsl:for-each select="...">
     <li>
       <a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName"/></a>
       <xsl:if test="./* [@isDoc]"><!-- Checks if current node has any children -->
         <ul>
           <xsl:for-each select="./* [@isDoc]">
             <li>
               <a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName"/></a>
             </li>
           </xsl:for-each>
         </ul>
       </xsl:if>
     </li>
    </xsl:for-each>

    Note it's much better to use apply-templates for this, especially if you're going deeper than 2 levels so you can re-use the code (the sitemap xslt uses this approach)...but this is just a quick example as it's getting late.  Chriztian might yell at me though :)

    You can use the same type of code for your left navigation.

    If you're having problems just paste the code you have and we'll try to help you out.  I only mentioned Razor because it looks like the existing site was done in .NET :)

    Hope this helps,
    Tom 

  • Mike 81 posts 101 karma points
    Jan 11, 2012 @ 21:18
    Mike
    0

    Hey Tom,

    The sitemap worked perfect. Took some time to study up on what was happening and getting it to work in the nav... But after playing around with it, I can't believe how simple all this was!!!

     

    Thanks again!

Please Sign in or register to post replies

Write your reply to:

Draft