We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17944
    • 9 Posts
    All I want from Wayfinder is a set of links like this:
    <a class="link" href="index.html">First</a><br class="hide" />
    <a class="link" href="index.html">Second</a><br class="hide" />
    <a class="link" href="index.html">Third</a><br class="hide" />
    <a class="link" href="index.html">Fourth</a><br class="hide" />
    

    In other words, how do I force off virtually all of the default Wayfinder templating?

    Thanks in advance...
      • 20413
      • 2,877 Posts
      Create Weblinks to docs!
        @hawproductions | http://mrhaw.com/

        Infograph: MODX Advanced Install in 7 steps:
        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
        • 6726
        • 7,075 Posts
        That’s a way to do it, but it would be time consuming and redundant.

        I would rather advise that you use Wayfinder templating capabilities (almost nothing you can’t do here).
        Check out : http://www.muddydogpaws.com/development/wayfinder/parameters.html

        In your case, create a chunk, put this code in it :

        <a href="[+wf.link+]" title="[+wf.title+]" class="link">[+wf.linktext+]</a><br class="hide" />
        


        In your Wayfinder call set &rowTpl=`your_chunk`

        You’ll also have to create a chunk for outerTpl so that your links don’t get wrapped in an ul... which is default.
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l&#39;outil id
          • 17944
          • 9 Posts
          Thanks for the replies (mrhaw and davidm)... I don’t yet know how to use weblinks in modx but I anticipate I will - just not right now.
          So if I’m using Wayfinder templating, my "outerTpl" chunk would just have my <div> plus the wrapper placeholder -- and look like this?
          <div class="vertmenu">
          <h2>Short Cuts</h2>
          [+wf.wrapper+]
          </div>
          

          Is this correct? Or is there more I need?

          Again, thank you in advance...
            • 7231
            • 4,205 Posts
            Yes. Or you could use an outerTpl with only the wrapper in it and use the wayfinder call like this:
            <div class="vertmenu">
            <h2>Short Cuts</h2>
            [!Wayfinder? &outerTpl=`chunk-name` &rowTpl=`chunk2-name`!]
            </div>


            It is up to you grin
              [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

              Something is happening here, but you don&#39;t know what it is.
              Do you, Mr. Jones? - [bob dylan]
              • 17944
              • 9 Posts
              This worked perfectly! And I’d like for all to see and understand the results because Wayfinder can be tuff for some of us...

              I wanted a Wayfinder call just to output a vertical stack of href links like this:
              <a class="link" href="index.html">First</a><br class="hide" />
              <a class="link" href="index.html">Second</a><br class="hide" />
              <a class="link" href="index.html">Third</a><br class="hide" />
              <a class="link" href="index.html">Fourth</a><br class="hide" />
              


              Using the suggestions in this thread, I put this Wayfinder call in the appropriate sidebar location of my template:
              <div class="rightsub">
              <h2>Quick Links</h2>
              [!Wayfinder? &startId=`22` &outerTpl=`04_subMenuOuter` &rowTpl=`04_subMenuRow`!]
              </div>
              


              ... and the ’04_subMenuOuter’ chunk has only this Wayfinder placeholder:
              [+wf.wrapper+]
              


              ... and the ’04_subMenuRow’ chunk looks like this:
              <a href="[+wf.link+]" title="[+wf.title+]" class="link">[+wf.linktext+]</a><br class="hide" />


              Obviously, my CSS was set up to use the classes mentioned and it worked perfectly the first time! Thanks all for the help!
                • 20413
                • 2,877 Posts
                Aha! tongue
                I thought you wanted them all linking index.html... Though that could
                also be acomplished by replacing [+wf.link+]... smiley
                  @hawproductions | http://mrhaw.com/

                  Infograph: MODX Advanced Install in 7 steps:
                  http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                  Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                  http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
                  • 17944
                  • 9 Posts
                  mrhaw points out an ugly flaw in my example. I really do want UNIQUE pages... a better example might be:
                  <a class="link" href="FIRST.html">First</a><br class="hide" />
                  <a class="link" href="SECOND.html">Second</a><br class="hide" />
                  <a class="link" href="THIRD.html">Third</a><br class="hide" />
                  <a class="link" href="FORTH.html">Fourth</a><br class="hide" />


                  Thanks, mrhaw, for pointing out that my example code needed clarifying...
                    • 7869
                    • 118 Posts
                    Quote from: magicflea at Feb 01, 2009, 03:31 PM

                    This worked perfectly! And I’d like for all to see and understand the results because Wayfinder can be tuff for some of us...
                    ...
                    Obviously, my CSS was set up to use the classes mentioned and it worked perfectly the first time! Thanks all for the help!

                    Yes, WF is tough for some of us so thank you VERY MUCH for posting your solution. This is similar to something I’m trying to do, however can anyone help me create a pipe separated link list like this...

                    LINK 1 | LINK 2 | LINK 3 | LINK 4

                    so there is one pipe between each link and no more. ie: If there’s 4 links, then there should be 3 pipes, not 4. I don’t want any pipes on the "outside" of the links.
                      -Dorian
                      • 25803 ☆ A M B ☆
                      • 721 Posts
                      Quote from: DorianJ at Mar 02, 2009, 05:51 AM

                      Yes, WF is tough for some of us so thank you VERY MUCH for posting your solution. This is similar to something I’m trying to do, however can anyone help me create a pipe separated link list like this...

                      LINK 1 | LINK 2 | LINK 3 | LINK 4

                      so there is one pipe between each link and no more. ie: If there’s 4 links, then there should be 3 pipes, not 4. I don’t want any pipes on the "outside" of the links.

                      I use an image for that, like this:

                      #mainnav ul li a {
                      	text-decoration: none;
                      	font-family: Geneva, Arial, Helvetica, sans-serif;
                      	font-size: 1em;
                      	color: #333333;
                      	padding: 12px 15px 10px 10px;
                      	background: url("../images/pipe.gif") no-repeat right 55%;
                      }


                      Use padding to control the placement left or right. I also use the class attribute last or first (depending on whether the pipe is placed left or right of the list item:

                      #mainnav ul li.last a, #nav-main ul li.last a {
                      	background: none;
                      }


                      This ensures that the pipe doesn’t appear behind the last menu item.

                      Finally, you need to activate those classes in the Wayfinder template (I always use a config file as I can never get a chunk to work for this):

                      <?php
                      
                      $firstClass = 'first';
                      $lastClass = 'last';
                      $hereTpl = 'active';
                      
                      $outerTpl = '@CODE:<ul>[+wf.wrapper+]</ul>';
                      
                      $rowTpl = '@CODE:<li[+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>[+wf.wrapper+]</li>';
                      
                      ?>
                      


                      I’m not sure how that is done in a chunk.