We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24074
    • 81 Posts
    Hi, i just have one simple, aesthetics question, nothing’s wrongwith my Wayfinder, just want to know whether its possible that Wayfinder instead of this:

    <!-- Navigation --> 
    <ul><li class="first active"><a href="http://event15.com/" title="Organizacija Žurki i Slavlja" >Naslovna</a></li><li><a href="usluge" title="Naše Usluge" >Usluge</a></li><li><a href="night-b4" title="Night B4 Koncept" >Night B4</a></li><li><a href="o-nama" title="O Nama" >O Nama</a></li><li class="last"><a href="kontakt" title="Kontaktirajte Nas" >Kontakt</a></li></ul> 


    generate this:

    <!-- Navigation --> 
    <ul>
    <li class="first active"><a href="http://event15.com/" title="Organizacija Žurki i Slavlja" >Naslovna</a></li>
    <li><a href="usluge" title="Naše Usluge" >Usluge</a></li>
    <li><a href="night-b4" title="Night B4 Koncept" >Night B4</a></li>
    <li><a href="o-nama" title="O Nama" >O Nama</a></li>
    <li class="last"><a href="kontakt" title="Kontaktirajte Nas" >Kontakt</a></li>
    </ul> 


    i just like my source pretty, readable and organized smiley

    Thanks
      Radio sucks!
      • 3749
      • 24,544 Posts
      I think if you provide your own Tpl chunks, carriage returns and indents will be honored in the output (though I haven’t tried it).
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 21838
        • 284 Posts
        It actually is as BobRay said.
          MODX Free Template Base: MODX-Boilerplate | my blog (lots of MODX stuff) | my gitHub (translations) | MODX User Groups Germany (Facebook)
          • 24074
          • 81 Posts
          i didn’t understand a worf of what you’ve said wink
          while still beginner, I’m not getting Wayfinder’s full potential and possibilities..

            Radio sucks!
            • 11076
            • 159 Posts
            here’s what they are talking about: grin

            for exmaple:
            [[Wayfinder? &startId=`0`
            &outerTpl=`your.OuterTpl.ChunkName` | The chunk should include: <ul>[[+wf.wrapper]]</ul>
            &rowTpl=`your.RowTpl.ChunkName` | The chunk should include: <li><a href="[[+wf.link]]">[[+wf.linktext]]</a></li>
            ]]
            * i assumed we’re talking about single level menu.

            in the template chunks you can form it as you wish (we’re defining patterns)
            and add another available placeholders if you wish (like classes/parents/ect..).
            to achieve your example add line breaks in the template/pattern-chunks and save them, it would keep the \n linebreaks.
            you can also add indentation (spaces or \t tab shifting) as you wish for achieve neat hierarchic source code.

            to get more grasp..

            Might Help:

              Michael Shraibman( gOmp)  | Freelance Design & Development | wink  impossible is nothing...
              • 11076
              • 159 Posts
              you can also use Source Code Indentation Pulgin
              http://modxcms.com/forums/index.php/topic,47198.msg334261.html#msg334261
              to shape things up by itself smiley

              * take in mind, if i’m not wrong, it might take some unwanted-havy processing time due to the use of RegEX. that said.
                Michael Shraibman( gOmp)  | Freelance Design & Development | wink  impossible is nothing...
                • 36404
                • 307 Posts
                hi,

                being a little fuzzy about code display too, coming to wayfinder, the easiest way i’ve found out to obtain a nice indented source code is to use a config file instead of chunks. Way finder call becomes really short and, in your config file (in the snippet/wayfinder/config directory you can write your html exactly as you want, even using \n at the end of lines or \t at the beginning

                when you use chunks just remember to leave an empty line at the end of each if you don’t want to have them output in a single line

                have swing
                  réfléchir avant d'agir
                  • 24074
                  • 81 Posts
                  thank you all people, will try some of your suggestions and get back with results
                  Cyaa
                    Radio sucks!
                    • 11076
                    • 159 Posts
                    Quote from: virtualgadjo at Dec 24, 2010, 03:19 AM

                    ..
                    being a little fuzzy about code display too, coming to wayfinder, the easiest way i’ve found out to obtain a nice indented source code is to use a config file instead of chunks. Way finder call becomes really short and, in your config file (in the snippet/wayfinder/config directory you can write your html exactly as you want, even using \n at the end of lines or \t at the beginning
                    ..
                    can you explain further on the config files and their usage ,maybe share an example? i didn’t know of this option.
                      Michael Shraibman( gOmp)  | Freelance Design & Development | wink  impossible is nothing...
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      Your Wayfinder snippet has only one parameter, &config=`filename`. Then you have a file, filename.config.php. That file has what would normally be parameters as ordinary PHP variable definitions:
                      $startId = 0;
                      $level = 1;
                      $outerTpl = '<ul>[[+wf.wrapper]]</ul>';
                      $rowTpl = '<li><a href="[[+wf.link]]">[[+wf.linktext]]</a></li>';
                      

                      This has a number of advantages; everything is in one file, you can use PHP code to generate conditional values, it doesn’t take up any cache space, and the variables don’t get dumped into the GLOBAL array as parameters and their values do.

                        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