We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17717
    • 433 Posts
    Hi all,

    I was just wondering how I could get Wayfinder to output Ordered lists (ol)

    Thanks
    Lee
      http://www.blend.uk.com | Web Design by Blend
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      See the Wiki or the Wayfinder docs about templates, and simply make up templates for the various parts as you wish. Lists, tables, divs, spans, whatever you want, Wayfinder will just put the various parts into the containers you specify in your templates.
        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
        • 10795
        • 38 Posts
        I’m just going to say that that answer is pretty poor. i would not call that helpful.
          • 18389
          • 169 Posts
          heheh.
          I’m glad you commented that 3+ years later giantcarrot.
          ?wtf?
            www.markojokic.com
            • 10795
            • 38 Posts
            Here’s a better explanation instead of just referring to the generally minimal and poor examples offered by the wiki or the strangely impossible-to-find compiled documentation for modx revolution 2+:

            I just started to try out modx and in regarding to the wayfinder snippet and how to format them it does seem confusing, I would not call it intuitive. Maybe it’s the lack of proper documentation and examples. For the many unordered lists posts answered, if it’s so simple surely someone could offer an example or two for an ordered list example, beside mine below also, if there are alternatives. Obviously such examples would help make the connection between css, placeholders, chunks, and snippets.

            There may be other methods for setting up the list tags <ol>,<li>, etc as in doing so in the actual chunk that you will need to create and then reference back in the wayfinder call in your template. I did this previously but lost the exact code and setup i used, but can offer this setup, which does work:

            1. Create a new document template.
            2. In your new template, using the wayfinder snippet, you need to make a call to 2 things: a) your css to format the list, b) an html "chunk" which holds the list placeholders or info to be outputted back to the wayfinder snippet.

            In your new template for example:

            <div id=’mynavlist’><ol>[[Wayfinder? &displayStart=`true` &startItemTpl=`navlist` &outerTpl=`navlist`]]</ol></div>

            Here you are using the wayfinder snippet (you need installed (3rd party package, http://wiki.modxcms.com/index.php/Wayfinder **be careful this doc has old syntax not for modx revolution)
            that through the above parameters will output the parent and direct children links in an ordered list.

            The outerTPL parameter (means outermost container) basically connects the called chunk, navlist, with the formatted div id you have in your template. The others - i believe - tell it "start item" at the same document you are creating in your document tree and also display all its children.

            3. So now you need a "chunk" of html with some placeholders that will return back the desired items from the document tree back to the wayfinder call. Create a new chunk and according to this example name the chunk "navlist"

            4. In the chunk, put the following:

            <span class="navlistlabel">[[+wf.linktext]]</span>[[+wf.wrapper]]

            the wf.linktext is the parent or start item or root of the list items that you’re calling from the document tree. I put a span around this that you can style in your css. This will just show the name. The wf.wrapper are rest of the list items set up by default as rows of <li>link</li>.

            5. Lastly set up the css need to process the list, EX:

            #mynavlist ol { margin: 0; padding: 0; list-style-type:decimal; }
            #mynavlist li { font: normal 12px Arial, Helvetica, sans-serif; }
            #mynavlist li a { font: normal 12px Arial, Helvetica, sans-serif; text-decoration: none; color: #000; }
            .navlistlabel { font: bold 14px Arial, Helvetica, sans-serif; }

            On your document that you have linked to a template with the above wayfinder call and chunk saved. This should return an ordered list, and specifically for this example for parent (itself in the tree and children).

            Like I said, i just started trying out modx revolution and this might be rouugh, there might be better or alternative ways. I hope other people can chime in, because in my opinion the modx ’learn’ section and regular documentation don’t exactly help make the fundamentals clear regarding calling and return diverse placeholders or what is already setup. Maybe I’m a person who learns by example and then doing. Well, here’s a simple example. Hope it helps somebody.
              • 10795
              • 38 Posts
              Re: Ordered List
              heheh.
              I’m glad you commented that 3+ years later giantcarrot.
              ?wtf?

              Well, I don’t just use modx but many other cms and systems. A matter of fact the last time i tried out briefly modx was version 1.0 of evolution, i believe. But I liked what i saw back then and planned on one day seriously using modx, which i will be doing now on a project.

              So.... everything is clear, except I was getting a little confused with wayfinder and some of the calls and placeholders, and I don’t have time currently to spend hours analyzing all the code-- i just wanted to use it, it shouldn’t be difficult right?

              Also, 3+ years later, who cares? There’s no other documentation that is acceptable nor any good answer for this simple topic, let alone other fundamentals of the system.

              But I guess the wtf means screw other new people who may now be getting interesting in modx.

              For all my scouting around here the last day or two, I’m shocked at how little examples or help there has been after 3+ years period.

              And regardless if that person is gone, no doubt someone else needing help will come along, and i hope i helped ’em. I sure could of used some instead of 2 useless comments.
                • 18389
                • 169 Posts
                I didn’t mean "wtf" in that way. I just found your first post really short and to a pretty old post. It was just funny to me. also equally useless to the first 2 posts perhaps.

                I do the same, in terms of combing through old posts to find answers. And definitely, responding to them will make them re-emerge as themes in the forum.

                One thing that I have noticed about modx forums in general, is that finding the answers for yourself is promoted by the coding people. So instead of just giving you the answer to your question, they will give you hints or point to where you need to read to find out. They like forcing you to do the work, which can be frustrating at times, but in the long run it has caused me to learn even more by reading stuff that I wasn’t necessarily inquiring about, in addition to finding the specific solution. Definitely time consuming.

                Wayfinder was probably one of the concepts that I couldn’t wrap my head around easily. Still is every time I am away from it for a while, in terms of the wrappers and all.

                I too learn better from working examples, and I wish there was more of that. I’d like to share how I made my personal site but haven’t come up with a solid format for laying it all out structurally for people to learn from.... any ideas out there?
                  www.markojokic.com
                  • 10795
                  • 38 Posts
                  Wayfinder was probably one of the concepts that I couldn’t wrap my head around easily. Still is every time I am away from it for a while, in terms of the wrappers and all.

                  exactly, when i first tried modx, and after exploring many cms. really none other cut the mustard. what appealed what modx flexible templating/css power. First hand I’m a CSS guy. But over the last couple years php with mysql coding experience bigtime, so i’m critical when communication or documentation is off. I also believe of course in the ability for people to code for themselves, although coming back totally fresh and upgrading or rather fresh-installing revolution 2 and hitting the placeholders and basic setup with wayfinder or rather passing simple styling (ex. <ol>) was a little confusing for some reason. Maybe I’m a bit rushed at the moment. But one thing I’m noticing right off the bat is that the current documentation is really bad, where just searching i had to find out from a 3rd party external site that placeholder syntax is different. After being away and coming to the various ui, syntax and other changes...it is like wtf. As far as hinting that is fine IF the documentation is there... BUT it’s not, only a very basic unexplained usage call and parameters list. For the <ol> completely unexplained, all the while this could greatly aid the overall learning process. I personally have no prob learning but for basic functionality I need it up right away and then as many of us site developers know it takes a good year to develop other aspects or functionalities to more substantial levels.

                  I’d like to share how I made my personal site but haven’t come up with a solid format for laying it all out structurally for people to learn from.... any ideas out there?

                  I think sort of blueprinting a site according to both functionality on one end and the basic templating structure on the other and then a section with examples on how the two sides interact.

                  I think the major sections would be:
                  - visual blueprints of main layouts
                  - functions/snippets used roster
                  - placeholders, template variables, and html chunks used
                  -code examples accompanied by short paragraph explanation
                  -plugins or javascript used, etc

                  Again, I’m only a day or two back in modx revo fresh.
                  I expect to be developing with modx revo starting next year frequently where i can chime in on such topics more.
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                      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
                      • 22427
                      • 793 Posts
                      Again, I’m only a day or two back in modx revo fresh.
                      I’m always astonished when somebody after just two days of working with a system rather new to him immediately starts complaining about the insufficient explanations, steep learning curve etc. Especially if someone is used to other CMS he is not "free" enough to let himself in to the new system. So it should not have been too difficult to understand that the unordered list, used by default in Wayfinder’s templates, can of course replaced by an ordered list...
                      It’s true that the documentation has to be improved, but as you can read elsewhere in the forum there are hard efforts going on to do it.