We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33968
    • 863 Posts
    Linked stylesheets should always go in the header of your html document.

    I think the &cssTpl parameter is for embedded css only - ie. css appearing between <style></style> tags within the body of your html. Its an optional parameter so you could comfortably remove it from the Wayfinder call and delete the ’cssplay_basicdd’ chunk.
      • 21759
      • 139 Posts
      Quote from: lucas at Mar 07, 2011, 01:25 PM

      Linked stylesheets should always go in the header of your html document.

      I think the &cssTpl parameter is for embedded css only - ie. css appearing between <style></style> tags within the body of your html. Its an optional parameter so you could comfortably remove it from the Wayfinder call and delete the ’cssplay_basicdd’ chunk.

      Thanks Lucas, I knew that css should be referenced in the header but I thought that was what the &cssTpl parameter was doing so I didn’t need to do it. I think I understand what you mean about it being embedded.

      I can’t understand why my menu is displaying the way it is. I’ve changed almost everything in the css file and nothing seems to fix it. I’ve even played around with the snippet call but nothing seems to work. Any ideas? http://www.bottlecaplure.com/newsite
        • 23299
        • 1,161 Posts
        This might help or not...

        I did a test install of Revo and got this very stripped dropdown menu to function. I purposely made the CSS very simple as its better to start simple and then get more fancy once its working.

        This went into my design template:
        <div id="banner">
          [[!Wayfinder? &startId=`0` &outerTpl=`mainNavOuter` &rowTpl=`mainNavRow` &innerTpl=`mainNavInner` &innerRowTpl=`mainNavInnerRow` &hereClass=`current_page_item` &firstClass=`` &lastClass =`` ]]
            </div><!--banner ends-->


        My menu chunks:

        mainNavOuter:
        <div id="mainNavBox">
        <ul class="mainNav">[[+wf.wrapper]]</ul>
        </div>


        mainNavRow:
        <li [[+wf.classes]]><a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]><span>[[+wf.linktext]]</span></a>[[+wf.wrapper]]</li>


        mainNavInner:
        <ul>[[+wf.wrapper]]</ul>​


        mainNavInnerRow:
        <li [[+wf.classes]]><a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]><span>[[+wf.linktext]]</span></a>[[+wf.wrapper]]</li>
        ​


        This menu CSS went into my main CSS file that I linked in the <head code>:
        #mainNavBox{
          border: 1px solid red;
          height:30px;
          margin:0 0 50px 0;}
          
        .mainNav {
          margin: 0;
          padding: 0;
          height: 1em; }
          
        .mainNav li {
          list-style: none;
          float: left; }
          
        .mainNav li a {
          display: block;
          padding: 3px 8px;
          background-color: blue;
          color: #fff;
          text-decoration: none; }
          
        .mainNav li ul {
           display: none; 
           width: 10em; 
           background-color: #69f;}
          
        .mainNav li:hover ul, .mainNav li.hover ul {
           display: block;
           position: absolute;
           margin: 0;
           padding: 0; }
          
        .mainNav li:hover li, .mainNav li.hover li {
           float: none; }
          
        .mainNav li:hover li a, .mainNavli.hover li a {
           background-color: #69f;
           border-bottom: 1px solid #fff;
           color: #000; }
          
        .mainNav li li a:hover {
           background-color: #8db3ff; }
          
        .current_page_item {
           font-weight:bold;}
          
        .mainNav li:hover ul li ul,
          .mainNav li a:hover ul li a ul {
          visibility:hidden; 
          position:absolute; 
          height:0; 
          width:0;}
          
          .mainNav li:hover ul li a,
          .mainNav li a:hover ul li a {
          display:block; 
          background-color: #69f;
          border-bottom: 1px solid #fff;
          color: #000;}
          
          .mainNav  li:hover ul li:hover ul,
          .mainNav li a:hover ul li a:hover ul {
          visibility:visible; 
          position:absolute; 
          left:100%; 
          top:30px;
          width:170%;}


        I then created a bunch of published resources: some were single pages, some were container resources with child pages and some of the child pages had their own child pages (grandchildren from the top row).

        This is not an attractive menu at all. But it all works. Its presented as a horizontal menu using floats. CSS is doing most of the work. I can then go in and add stylish colors or background images to the resting states, active states and hover states etc.

        I did not use any download like one of Stu’s great menus. Instead I got the basic row templates working and then made note of the divs, classes and CSS cascade that were generated in the markup. From there I built each part of CSS. The parent rows are easy. The child rows are more tricky but pay attention to the CSS cascade laws and all is good.

        This is my method for tacking this problem. Your mileage may vary...

        Max
          • 21759
          • 139 Posts
          Max, thanks for all your help I’ll give your example a go and see if I can make it work. I’m still going to keep trying with the examples also however because I don’t like it when I cannot solve something. wink

          Is there a link somewhere that has all the css laws in one place? I didn’t see any references on any of the css sites I’ve been to.
            • 21759
            • 139 Posts
            huh I set up the chunks as per your post, inserted your snippet call as is into my header chunk and created a new css style sheet named banner.css where I placed your css code and linked to it in my header but nothing shows. I even tried pasting the css into my template css file but that didn’t work either. Wow I’m really struggling with this for some reason.
              • 33968
              • 863 Posts
              I’ve just had a quick look at your website and the stylesheet seems to be linked up correctly now. The red border is showing up on #mainNavBox. But looking into your html source, it’s clear that the row and inner templates are not being pulled in:

              <div id="banner">
                <div id="mainNavBox">
                  <ul class="mainNav"></ul>
                </div>
              </div>


              Let’s go back to basics and use only the default Wayfinder templates. Try the following call and see if outputs your site structure:

              [!Wayfinder? &startId=`0`!]


              Is that working for you? If so, we can work on styling it up...
                • 21759
                • 139 Posts
                Okay first I would like to thank everyone for their help, much appreciated. I am a still learning css. I couldn’t get the wayfinder snippet to work for me so I went with adding the list inside my headerChunk and an external stylesheet for the menu code. This is code that I purchased from a dev guy a while back so I didn’t write the original css structure. I have made changes to color, rounded corners, images etc. Stuff I can do.

                I’m not sure why I cannot get my head around wayfinder but I think it has to do with my lack of php knowledge and poor css skills. Could be that I’ve only ever built sites with Dreamweaver also. Now to see how it looks in other browsers. Once I get it where I want it I’ll post my code in case someone else is like me and has to hard code the menu. Maybe I’ll be able to figure out how to do it in wayfinder eventually to help me save some time.

                Update: Wow that joyful feeling was short lived. Looks terrible in different resolutions, safari and IE 6 of course. Back to the drawing board.
                  • 23299
                  • 1,161 Posts
                  It looks like the entire menu bar has absolute positioning? If you make the browser window wider the menu will stay in the same position no matter the size of the browser. That should be easy to fix. Also make sure your menu is inside the wrapper you are using for your template. I think you need a little more padding on the right side of the links as well? The links run out of room on the right side when the user increase the text size by one level. You will want at least one user text size increase before the layout suffers any ill effects.
                    • 33968
                    • 863 Posts
                    Quote from: nootkan at Mar 08, 2011, 05:07 PM

                    I’m not sure why I cannot get my head around wayfinder but I think it has to do with my lack of php knowledge and poor css skills.

                    You don’t need any php knowledge to use Wayfinder, or for any of the default snippets/plugins that come with MODx.

                    Did you try the basic Wayfinder call exactly as I suggested above? I can’t see any reason why that wouldn’t work.
                    It won’t be styled but we can walk you through that once you have something to work with...
                      • 21759
                      • 139 Posts
                      Yeah, I’ve tried everything I can think of and all the things you’ve suggested. I can make the sliding doors example work but not the others. I even bought a book on modx and followed the tutorial in there on wayfinder and the menu I created there worked fine, but when I tried to do the same steps with the menu that I actually want to use it fails. The css for the menu that I want to use was already created for me and I cannot follow all of it, but I do understand a bit of it. I can create this menu in dreamweaver and make it work (http://www.sportsmanfishing.com) but cannot seem to figure out how to make it work in modx. That is why I tried to add the list code directly into my headerChunk using the exact same layout structure but it doesn’t work properly either. Maybe I should just give up on Modx and stay with dreamweaver I don’t know. Sorry for my frustration but I’ve been at this for a few days now and this isn’t even my day job. embarrassed