We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29344
    • 18 Posts
    Modx Revo - Wayfinder 2.1.1


    These are 2 completely newb questions, and I couldn’t find any answers in the threads, so hopefully someone will be nice enough to clarify things for me. smiley

    1. I’ve been creating deleting a lot of resources in my quest to understand modx, so the result is that my homepage has a resource id of 33, lol. So in order to have the index use 33, not 1, I changed my system settings to site_start = 33. My question is why does the below syntax work:

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


    and not this :
    [[Wayfinder? &startId=`33`]]


    2. What is the difference in a [[+wf.classnames+]] and a &outerClass when it comes to customizing the example below?

    <ul class="nav"
       <li><a href="#">Home></a></li>
       <li><a href="#">About></a></li>
       <li><a href="#">Contact></a></li>
    </ul
    


    Quoting Kondongo’s documentation: "There might be times when alongside Wayfinder classes, you want to add your own custom classes to a particular template/xhtml element." With that said, why wouldn’t I op to use the following in my chunk:

     <ul class="[[+wf.classnames+]] nav"></ul>  


    Instead, he uses
     [[Wayfinder? &startId=`0` &outerTpl=`menuContainer` &outerClass=`nav`]] 


    I’m just not understanding the concept there, or maybe I don’t understand classnames....


    Thanks alot guys!
      • 8609
      • 607 Posts
      Quote from: tavcorp at Feb 09, 2011, 12:57 PM

      Modx Revo - Wayfinder 2.1.1


      These are 2 completely newb questions, and I couldn’t find any answers in the threads, so hopefully someone will be nice enough to clarify things for me. smiley

      1. I’ve been creating deleting a lot of resources in my quest to understand modx, so the result is that my homepage has a resource id of 33, lol. So in order to have the index use 33, not 1, I changed my system settings to site_start = 33. My question is why does the below syntax work:

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


      and not this :
      [[Wayfinder? &startId=`33`]]



      &startId = `0` tells wayfinder to start with the root of your site. So this will list all your pages including your home page. If you used &startId = `33` then Wayfinder would list any documents that you had created with the document with id 33 as their parent. So say your site tree looks like this:

      Home(33)
      --Homechild1(34)
      --Homechild2(45)
      About Us(35)
      Contact Us(58)

      Then if you specified startId to be 0 and didn’t specify the level, wayfinder would list Home, About Us, Contact Us, Homechild1, Homechild2
      However, if you specified startId to be 33, Wayfinder would only list Homechild1 and Homechild2.

      Does this help?
        • 8609
        • 607 Posts
        Quote from: tavcorp at Feb 09, 2011, 12:57 PM

        Modx Revo - Wayfinder 2.1.1

        2. What is the difference in a [[+wf.classnames+]] and a &outerClass when it comes to customizing the example below?

        <ul class="nav"
           <li><a href="#">Home></a></li>
           <li><a href="#">About></a></li>
           <li><a href="#">Contact></a></li>
        </ul
        


        Quoting Kondongo’s documentation: "There might be times when alongside Wayfinder classes, you want to add your own custom classes to a particular template/xhtml element." With that said, why wouldn’t I op to use the following in my chunk:

         <ul class="[[+wf.classnames+]] nav"></ul>  


        Instead, he uses
         [[Wayfinder? &startId=`0` &outerTpl=`menuContainer` &outerClass=`nav`]] 


        I’m just not understanding the concept there, or maybe I don’t understand classnames....


        Thanks alot guys!


        Does your classnames option work? It should as far as I can tell. In his case, I suspect he is using [[wf.classes]] in his chunk, i.e. <ul [[wf.classes]]> in which case Wayfinder will replace wf.classes with class="nav". It’s been a while since I read the WF book but I believe this is the case.

        Remember wf.classnames won’t output class="" but wf.classes will. So if you use wf.classes and don’t specify &outerClass or &innerClass then the output will simply be <ul class="">

        Does this make sense?
          • 29344
          • 18 Posts


          Does your classnames option work? It should as far as I can tell. In his case, I suspect he is using [[wf.classes]] in his chunk, i.e. <ul [[wf.classes]]> in which case Wayfinder will replace wf.classes with class="nav". It’s been a while since I read the WF book but I believe this is the case.

          Remember wf.classnames won’t output class="" but wf.classes will. So if you use wf.classes and don’t specify &outerClass or &innerClass then the output will simply be <ul class="">

          Does this make sense?


          That does make sense, I think. And the classnames do work. The frustrating thing is that the site defaults to the css of regular anchor tags, and not the style of my ".nav". I’m getting the same output, wither or not I’m using

           <ul class="[[+wf.classnames+]] nav">[[+wf.wrapper+]]</ul> 

          with
           [[Wayfinder? &startId=`0` &outerTpl=`menuContainer &outerClass=`nav`]]  


          or

           <ul[[+wf.classes+]]>[[+wf.wrapper+]]</ul> 

          with
           [[Wayfinder? &startId=`0` &outerTpl=`menuContainer &outerClass=`nav`]]  


          It’s even the same if I just use

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


          So I’m still not really sure what is doing what. I assume I don’t need the [[+wf.classnames]] in the chunk if i just specify the &outerClass=`nav` on the template, correct? But since I’m getting the same output, no matter what I change, are they all just defaulting to <ul class="">? Is that why they are styled like anchor tags and not li items?

          Here’s my CSS just in case, but I’m pretty sure that all checks out:

          #sidebar ul.nav{
          	text-align: left;
          	margin: 7px 5px 8px 0px; padding: 0;				
          }
          #sidebar ul.nav li {
          	list-style: none;
          	padding: 8px 10px;
          	margin: 0;		
          	border-bottom: 1px solid #111;
          }
          * html body #sidebar ul.nav li {
          	height: 1%;
          }
          #sidebar ul.nav li a {
          	text-decoration: none;	
          	border: none;
          	color: #5d5d5d; 	
          		
          	font-weight: bold;		
          	font-family: 'Trebuchet MS', Tahoma, Helvetica, Arial, Sans-serif;
          	font-size: 14px;	
          	/* letter-spacing: .5px;  */
          }
          #sidebar ul.nav li a span {
          	color: #444;	
          	font-family: Georgia, 'Times New Roman', Times, serif;
          	font-style: italic;
          	font-weight: normal;	
          	font-size: 11px;
          }
          #sidebar ul.nav li a:hover,
          #sidebar ul.nav li a:hover span {	
          	color: #fff;	
          }
          #sidebar ul.nav ul { margin: 0 0 0 5px; padding: 0; }
          #sidebar ul.nav ul li { border: none; }
          
          


          And the complete template code:

          <body>
          <div id="wrap">  <!-- wrap starts here -->
               [[$Color Header]]
          	<div id="content-wrap">  <!-- content-wrap starts -->		
                          <div id="main">
          		    [[*content]]
                          </div>
                          <div id="sidebar">
                              [[Wayfinder? &startId=`0` &outerTpl=`menuContainer &outerClass=`nav`]] 
          		    [[*color home-sidebar info]]
                              [[*color home-sidebar info2]]
                          </div>
          	</div>  <!-- content-wrap ends-->
          	[[$Color Footer]]
          </div>  <!-- wrap ends here -->
          </body>
          </html>
          
          


          I hope this all makes sense embarrassed, thanks for your help.
            • 29344
            • 18 Posts
            If I may add, I installed Firebug and it seems that modx simply doesn’t know that my <ul> has a class attached to it! Ahh, so close...
              • 8609
              • 607 Posts
              &outerTpl=`menuContainer`

              You’re missing the closing ` wink
                • 29344
                • 18 Posts
                Quote from: einsteinsboi at Feb 09, 2011, 03:10 PM

                &outerTpl=`menuContainer`

                You’re missing the closing ` wink


                undecided
                Thanks for catching that, but when I closed it, the entire list disappears. Lol, at least it did something!! Just to clarify, I am now using this for my chunk:

                 <ul[[+wf.classes+]]>[[+wf.wrapper+]]</ul>  


                and this for my template:

                 [[Wayfinder? &startId=`0` &outerTpl=`menuContainer` &outerClass=`nav`]] 


                I even changed my doctype to transitional 1.0 like advised in another thread (it was strict) and tried different spacing for the template syntax... still no luck. I’ll keep trying though smiley.
                  • 22427
                  • 793 Posts
                  May be you find the explanations in this older thread helpful:
                  http://modxcms.com/forums/index.php/topic,8382.msg186185.html#msg186185
                  But observe that it was written for Evo, so the placeholder syntax must be changed: [+wf.classes+] is to replace by [[+wf.classes]] and so on.

                  And you’re right: [tt]<ul [[+wf.classes]]>[/tt] is equivalent to [tt]<ul class="[[+wf.classnames]]">[/tt] ,
                  and you use the latter when you want to add an extra class name, like in
                  [tt]<ul class="[[+wf.classnames]] nav">[/tt]

                  @einsteinsboi:
                  Then if you specified startId to be 0 and didn’t specify the level, wayfinder would list Home, About Us, Contact Us, Homechild1, Homechild2
                  Wouldn’t be the output in the following order?
                  [tt]Home, Homechild1, Homechild2, About Us, Contact Us[/tt]
                    • 22427
                    • 793 Posts
                     <ul[[+wf.classes+]]>[[+wf.wrapper+]]</ul>
                    I’m not sure, but the missing blank after [tt]<ul[/tt] might be harmful; try
                     <ul [[+wf.classes+]]>[[+wf.wrapper+]]</ul>
                      • 29344
                      • 18 Posts
                      Quote from: ottogal at Feb 09, 2011, 03:38 PM

                      May be you find the explanations in this older thread helpful:
                      http://modxcms.com/forums/index.php/topic,8382.msg186185.html#msg186185
                      But observe that it was written for Evo, so the placeholder syntax must be changed: [+wf.classes+] is to replace by [[+wf.classes]] and so on.

                      Hey thanks for your input ottogal! And I found that thread right before my previous post, which gave me the idea about the doctype and spacing issues. None of which changed anything but your clarification in the thread was very helpful.

                      ** I tried that space in the <ul> and that didn’t work either. sad

                      This issue is starting to go beyond me. Einsteinboi caught a mistake of mine, where the &outerTpl=`menuContainer was missing the closing `. But when I closed it, the damn list disappears!!! So i unclose the &outerTpl and it reappears again! Haha, I don’t know what to make of this. Once I can resolve this issue, the main problem still lies in telling modx that i have a <ul class="nav"> and it needs to use it. Please refer to my css and html above, if you don’t mind.

                      Thanks again.