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

    I have been using wayfinder with a custom cache wrapper like so:
    [[!getCache?
        &cacheKey=`persist_forever`
        &element=`Wayfinder`
        &elementClass=`modSnippet`
        &cacheElementKey=`[[+wfCacheElementKey]]`
        &startId=`0`
        &level=`2`
        &cacheResults=`1`
        &cacheTime=`0`
        &scheme=`full`
        &parentRowTpl=`navigation-parent`
    ]]
    


    so
    &scheme=`full`
    should make all URLs absolute as by the docs here: http://rtfm.modx.com/display/ADDON/Wayfinder.


    &scheme

    format for how URLs are generated. Possible values are (based on makeURL API call):

    -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
    (added in 2.3.1-pl)

    But it won't do absolute addresses for weblinks within its elements. Why is that?

    I played with
    useWeblinkUrl
    a bit but to no effect.

    Any hints here?
      • 44234
      • 219 Posts
      Have you tried it with just a standard wayfinder call to check if it's getCache causing the issue?
        Find me on Twitter, GitHub or Google+
        • 44320
        • 17 Posts
        Hi David

        I have yes:
        [[Wayfinder?
            &startId=`0`
            &level=`2`
            &cacheResults=`1`
            &cacheTime=`0`
            &scheme=`full`
            &parentRowTpl=`navigation-parent`
        ]]
        


        Will also only output relative addresses for only weblinks... All others have absolute addresses...

        So this is not a expected result then? I wasn't sure about how wayfinder handles weblinks.
          • 32699 ☆ A M B ☆
          • 427 Posts
          Not sure what you mean "its elements".

          But you can also do:

          [[~665?scheme=`https`]] 
          [[~[[*id]]?scheme=`https`]]
          [[~[[+id]]?scheme=`https`]]
          [[~[[+item.resourceid]]?scheme=`https`]]
          
            Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

            Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com
            • 44320
            • 17 Posts
            Hi Shawn

            with "it's elements" I mean to describe the pages [[wayfinder]] iterates over.
            So all I want is every link that is returned from the query to be absolute.

            I am not sure how to use your code example? Within the parentRowTpl snippet?

            Thanks anyway
              • 32699 ☆ A M B ☆
              • 427 Posts
              Quote from: dominikwilkowski at Jul 28, 2013, 10:17 PM
              Hi Shawn

              with "it's elements" I mean to describe the pages [[wayfinder]] iterates over.
              So all I want is every link that is returned from the query to be absolute.

              I am not sure how to use your code example? Within the parentRowTpl snippet?

              Thanks anyway

              Try using &scheme=`http`.

              Here is a call I use for absolute on a secure section of a current project:
              [[!Wayfinder:strip? 
                      &startId=`[[+site_start]]`
              	&contexts=`operations` 
                      &displayStart=`0` 
                      &excludeDocs=`351,1`
              	&level=`3` 
                      &outerTpl=`tpl.Wayfinder.outer`
              	&parentRowTpl=`tpl.Wayfinder.row.parent`
              	&innerRowTpl=`tpl.Wayfinder.row.inner` 
                      &rowTpl=`tpl.Wayfinder.row`
              	&schema-`abs`]]
              
                Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

                Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com
                • 44320
                • 17 Posts
                I tried http and https and all of the other options mentioned in the manual here: http://rtfm.modx.com/display/ADDON/Wayfinder

                It does not work either sad
                  • 32699 ☆ A M B ☆
                  • 427 Posts
                  Quote from: dominikwilkowski at Jul 28, 2013, 10:26 PM
                  I tried http and https and all of the other options mentioned in the manual here: http://rtfm.modx.com/display/ADDON/Wayfinder

                  It does not work either sad

                  You are using Revolution, correct?

                  If so. There is little reason it doesn't work for you. Did you clear the cache? There is no reason to use I can see to use getCache with Wayfinder.

                  Gid rid of the wrapper and call wayfinder cached.
                    Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

                    Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com
                    • 44320
                    • 17 Posts
                    I am using MODX Revolution 2.2.8-pl (traditional) and have moved away from the wrapper as described above.

                    I am using
                    [[Wayfinder?
                        &startId=`0`
                        &level=`2`
                        &cacheResults=`1`
                        &cacheTime=`0`
                        &scheme=`full`
                        &parentRowTpl=`navigation-parent`
                    ]]
                    


                    and have added a comment <!-- testnav --> too as to see with I have a cache problem. Unfortunately I do not that is to say the comment will appear on the outputted HTML plus the mix of relative and absolute urls...
                      • 32699 ☆ A M B ☆
                      • 427 Posts
                      Quote from: dominikwilkowski at Jul 28, 2013, 11:23 PM
                      I am using MODX Revolution 2.2.8-pl (traditional) and have moved away from the wrapper as described above.
                      and have added a comment <!-- testnav --> too as to see with I have a cache problem. Unfortunately I do not that is to say the comment will appear on the outputted HTML plus the mix of relative and absolute urls...

                      There are a few things you must understand about the cache, but I will not go into them here suffice to say, the cache operates before the page every is sent to the web browser.

                      If you want to send a comment to the page without it being visible in the source utilize the MODX tag intended for that purpose [[- some comment here ]]

                      Did you clear the cache?
                      Did it work?
                      You may have to use an FTP, SCP, SFTP, SSH, Telnet, or some other medium and manually delete the cache folder under the core directory.

                      /core/cache. Go into the folder, verify you are indeed in the /core/cache folder and delete everything in it.

                      MODX will recreate it as it needs too.

                      Be care not to delete the wrong content, or your site will be damaged.


                      By the way, what do your links actually come out looking like?
                        Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

                        Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com