We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20914
    • 0 Posts
    example:
    Imprint | Services | Contact us |

    <li[+wf.id+][+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a>[+wf.wrapper+] |</li>

    how must i go to have WF omit the last pipe?

    help much appreciated, many thanks!

      moddex is cool
      • 4172
      • 5,888 Posts
      Quote from: nameuser at Jul 31, 2011, 09:28 AM

      example:
      Imprint | Services | Contact us |

      <li[+wf.id+][+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a>[+wf.wrapper+] |</li>

      how must i go to have WF omit the last pipe?

      help much appreciated, many thanks!



      I’m not sure it this will work. You can try this:



      create a new snippet ’pipe’:

      <?php
      $id = isset($id) ? $id : '';
      $output = $modx->getPlaceholder('pipe'.$id);
      $modx->setPlaceholder('pipe'.$id,'|');
      return $output;
      


      and use it like that:
      <li[+wf.id+][+wf.classes+]>[[pipe? &p=`[+wf.id+]`]]<a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a>[+wf.wrapper+]</li>


      this should place a pipe at the beginning of each li, but not on the first one. Does it?
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 22427
        • 793 Posts
          • 34147
          • 28 Posts
          If the height of your navigation are all the same height you could add a "pipe" by using border-right on all li items except the last li.

          Something like:
          nav ul li {
          font-size: 16px;
          height: 16px;
          border-right: 2px solid red;
          }
          
          nav ul li:last-child {
          border: 0;
          }

          This way no matter how many items you have, the last will not have a border.
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            I prefer to use a background image for the li or the a element set to top right no-repeat display in the CSS, and of course the .last (or .first, as appropriate) doesn’t have the background image. The image only needs to be one or two pixels wide. You can do much nicer borders with such a method. For example, a black background and a 2-pixel wide image can look like this
              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
              • 20914
              • 0 Posts
              many, many thanks to all!
              (haven’t tried yet but i’m sure one and/or the other...)
                moddex is cool
                • 20914
                • 0 Posts
                doh! me...
                i overlooked wayfinder’s class="last" function *blush*

                but the tips were still quite enlightening!
                  moddex is cool