We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44587
    • 31 Posts
    What's the best url generation scheme to use? I'm trying to navigate from the children to one of the parents but it generates the wrong url. The url generations scheme i have now is link tag scheme

    This question has been answered by bintimalu. See the first response.

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      <a href="[[~[[*parent]]]]">Parent</a>

      That should do the job. If you need to go higher, use the Ultimate Parent snippet instead of the parent tag.
        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
        • 44587
        • 31 Posts
        so where do I place that because right now it has the key as link_tag_scheme and the value as -1
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          link_tag_scheme only specifies if a URL should be relative (page.html), absolute (/page.html) or full (http://mydomain.com/page.html), and if it's http or https.
          -1 : (default value) URL is relative to site_url
          0 : see http
          1 : see https
          full : URL is absolute, prepended with site_url from config
          abs : URL is absolute, prepended with base_url from config
          http : URL is absolute, forced to http scheme
          https : URL is absolute, forced to https scheme
            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
            • 44587
            • 31 Posts
            Canyou please elaborate, it's my first time working with websites so I'm not certain about whatyou mean
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Look at the URL that gets generated. Using the default -1 setting, you would get "page.html". If you use full, you'll get "http://domain.com/page.html". Using abs (absolute) will get "/page.html", or in my case since I have MODx installed in a subdirectory, I get "/revo228/page.html" (note the leading /, this indicates the beginning of the web root). 0 is the same as full, using http. 1 is the same as full, only using https.

              MODx automatically generate values for base_url, which is usually just / (or in my case /revo228/), and site_url, which is the full http://domain.com/ (in my case, http://localhost/revo228/)

              You can see these if you put [[++site_url]] and [[++base_url]] in a resource and view it.

              I don't think that this setting has anything to do with what you are trying to 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
                • 44587
                • 31 Posts
                So this will not help me fix the problem of navigating between the parent and children. I thought the problem might have been that the parent url freezes that is why it gives me the wrong url
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  1. How are you creating the link?

                  2. What, exactly, do you expect to get, and what are you getting instead?

                  3. Do you have a base tag in your template head?
                  <base href="[[++site_url]]">
                    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
                    • 44587
                    • 31 Posts
                    For instance if I'm trying to navigate from:
                    http://eldersdigest.org/media/media/Videos

                    to go to of of the other pages, I get the url:
                    http://eldersdigest.org/media/elders-digest

                    instead of:
                    eldersdigest.org/elders-digest

                    Media is the parent of Videos
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      Hm. You definitely have a problem. http://eldersdigest.org/media/media/media/whatever is not going to go anywhere.

                      Here's what I would do if I were you. Forget the fancy Javascript stuff for now. Just do a plain Wayfinder snippet with the default tpls : [[Wayfinder? &startId=`0`]]

                      This will give you a simple nested unordered list. Get this working before you try adding the Javascript bells and whistles.

                      Make sure you have the <base href... tag I mentioned before in your template head; put it right after the title tags.
                        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