We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10726
    • 58 Posts
    I have a set of pages that I want to index via simple menu that I put into the chunk like this:

    <ul>
    <li><a href="[~39~]">Link 1</a></li>
    <li><a href="[~44~]">Link 2</a></li>
    <li><a href="[~45~]">Link 3</a></li>
    <li><a href="[~46~]">Link 4</a></li>
    <li><a href="[~47~]">Link 5</a></li>
    <li><a href="[~48~]">Link 6</a></li>
    <li><a href="[~49~]">Link 6</a></li>
    </ul>

    Is it possible to display a page title for each page via variables, instead of hardcoding text (Link1, Link2, etc...) ?

    I’ve searched forums for possible answers but couldn’t seem to find it.

    Gleb
      • 11975
      • 2,542 Posts
      Hi,

      you could easily achieve this using the wayfinder snippet which is a menu builder.

      :-)
        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 7455
        • 2,204 Posts
        if you still want to use a chunk instead of wayfinder you could you a snippet called getfield
          follow me on twitter: @dimmy01
          • 10726
          • 58 Posts
          Well,
          Is there a way to do something like this with ModX: [get_page_title_of(45)] ?

          Gleb

            • 10726
            • 58 Posts
            Thank you for your replies.
            I dont mind doing with WayFinder - but i couldn’t seems to figure out how can include in wayfinder only pages that I want and exclude all others.

            Gleb
              • 11975
              • 2,542 Posts
              It depends on your website architecture.
              You can gather the docs in a folder which will be your StartID param
              You can uncheck the show in menu box to prevent document to be listed.

              :-)
                Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                • 10726
                • 58 Posts
                Ok, I’ll try to struggle with CSS and Wayfinder... It’s going to be a battle but I guess the benefits would be longer lasting than using duct tape solutions smiley

                Gleb
                  • 7923
                  • 4,213 Posts
                  Like Dimmy said, there is a snippet by the name "GetField" that can retrieve any MODx document object field from specified document.


                    "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                    • 12652
                    • 228 Posts
                    Actually, Wayfinder works incredibly well right out of the box. You can obviously get very complex with it if you want, but so far, for simple CSS styled ul type navigation, horizontal as well as vertical, it hasn’t required anything special, and the "you are here" kind of locator is much easier than in a hard-coded design.
                      | Identity Developments delivers SEO focused web design and web presence services
                      - it&#39;s not about websites, it&#39;s about your identity. |
                      • 10726
                      • 58 Posts
                      I found a few samples from original WayFinder site - are there more samples available around including CSS and chunks samples as well?

                      Gleb