We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4310
    • 2,310 Posts
    Looking good.
    It would need some more work for your third level item to show!
      • 36693
      • 66 Posts
      Hi all.

      I have this working at http://pages.bfenthusiasts.com (thanks to this thread). I hoped to be able to have two colours, one for the top strip background and one for the bottom, even when the bottom is empty.

      Is this possible? I’ve been looking at the code for ages but can’t seem to work out how to do it.
        • 6501
        • 5 Posts
        Hello All, I see no one has posted here for a while but I have a problem that I have been scratching my head over for a while now so hope someone picks this up.

        Here is the issue:

        I am using the dropline menu solution povided above which works great, thanks for that. With some css I have got each of my menu items color coded. However to get the sub menu background coded the same color I need to add an "id" to each sub ul. However I can’t seem to do this. For the color coded menu items I have added class="[+wf.title+]" (I’ll change this to [+wf.link+] once I have implemented friendly url’s). However in the $innerTpl if I add ’@CODE:<ul id="[+wf.title+]" [+wf.classes+]> the id remains blank. How can I call this or better yet add a unique ID based on some other parameter.

        Thanks in advance
        Alastair
        Alastair
          • 4310
          • 2,310 Posts
          I suppose the
          <ul id="[+wf.title+]"
          isn’t getting a value because the <ul> is a wrapper, it’s the <li> that gets document values.
          Untested, but you could try [+wf.id+] and see if that works.
            • 12147
            • 182 Posts
            Bunk58,

            Would you have any idea how to modify this so that the subnav is centered underneath its active topnav (rather than aligned left)?

            This is exactly what I need, but can’t yet work out WF with anchor classes.http://bit.ly/4ssLdf" target="_blank" rel="nofollow">Centered any width dropline http://bit.ly/4ssLdf

            Desperate for ideas... hugely grateful for any help!

            smiley

              • 28042 ☆ A M B ☆
              • 24,524 Posts
              I did this by giving every row item a unique ID using the [+wf.id+] placeholder and the &rowIdPrefix placeholder, so each item has an ID of "rowxx", where the xx is the resource ID. Then in the CSS I manually shifted the leftmost item of each submenu over as far as necessary to center the submenu on the parent menu item.

              If someone has a better way to do this, I would be very happy to hear about it.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 4310
                • 2,310 Posts
                display: block;
                position: relative;
                left: -50%;
                Applied to the sub menu is how Stu Nicholls does it.
                  • 6501
                  • 5 Posts
                  Hi, thanks for the reply. I tried id="[+wf.id+]" but the ID still remains blank, as you say becuase it is a wrapper. I’ll keep going and try other solutions, but any help would be appreciated. I’ll post the solution if I manage to do it.

                  This would also solve the solution of the centered sub navigation as you can set the width of the <ul> and then pad left as required, subtracting the padding from the width, something like this:

                  #nav ul #YourID {width:960px; background-color:#00a5ad;padding-left:400px; width:560px;}

                  Alastair
                    • 6501
                    • 5 Posts
                    Ok I have fixed this now. I added the id on to the $parentRowTpl and then changed the css. This also allows you to pad-left so you can center your sub navigation. Below is the code I changed. Just note that at the moment the ID is based on the title (id="[+wf.title+]")tag, I recommend this is changed to [+wf.link+] once friendly URL’s are implemented so your title tags can be more SEO friendly. Hope this helps someone else.
                    Alastair

                    The Code:
                    $parentRowTpl = '@CODE:<ul id="[+wf.title+]" class="select">
                    	<li>
                    	<a class="[+wf.title+]" href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]
                    	<!--[if IE 7]><!--></a><!--<![endif]-->
                    	[+wf.wrapper+]
                    	</li></ul>';


                    The CSS:
                    #nav .select a.TitleClass {background-color:#000;}
                    #nav .select li:hover .TitleClass {background-color:#43ba83;}
                    ul#TitleID li ul {background-color:#43ba83!important; padding-left:200px!important; width:760px!important;}
                    ul#TitleID li ul li a {background-color:#43ba83!important;}


                    Note the use of the !important declaration, this is need to overide settings in the CSS already set earlier.
                      • 4310
                      • 2,310 Posts
                      Good work Danny smiley