On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Quote from: sottwell at Dec 03, 2014, 01:25 PM
    What does the Wayfinder snippet in the switched template look like? Are the two snippet calls the same on both templates?

    The snippets calls are the same.
    For test I created 1 temlate, but open resource with 2 links:
    mysite.com/index.php?id=13 - normal open (got full menu)
    mysite.com/index.php?id=13&mode=spt - switchtemplate open (got 1-level menu)

    Looks like [[+wf.wrapper]] - placeholder is emty. I dont know how to debug it. [ed. note: amberlionk last edited this post 6 years, 10 months ago.]
    • I don't know what to say to you. I just installed it, tried it, and it's not having any problems with the menu.

      Here is my chunk for testing
      <!doctype html>
      [[pdoMenu? &parents=`0`]]
      <p>This is a test.</p>

      The menu is the same as for the main template (BaseTemplate)
      <!doctype html>
      <title>[[++site_name]] - [[*pagetitle]]</title>
      <base href="[[++site_url]]" />
      [[pdoMenu? &parents=`0`]]
        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
      • Strange, with pdoTools menu, it work fine, with wayfinder - dont.
        Maybe its time to move to pdoTools.
        • During my tests I have used pdoTools too. So I did not see the Wayfinder issue …

          There could be some issues in SwitchTemplate i.e. with placeholders and context/system setting placeholders. It is more a hack to bypass the missing template switch but hopefully a good one.
          • Quote from: Jako at Nov 07, 2014, 01:26 PM
            Second way is the same as you want.

            The "Chunk/Template Name" field contains i.e. '[[*templatevar]]SwitchTpl' and the TV template var is filled for a resource with 'whatever'. Then the alternate template for that resource is changed to 'whateverSwitchTpl'. The other resources use the 'SwitchTpl' alternate template.

            I Jako! Any news for this implementation?
            • Sorry for answering that late. I will work on SwitchTemplate next week.
              • Thank you Jako!
                • Quote from: Jako at Jan 16, 2015, 07:24 AM
                  Sorry for answering that late. I will work on SwitchTemplate next week.

                  Hi Jako, how can I help you with the implementation I need?
                  • Use the latest version of this extra. It could use i.e. [[+alias]]Whatever as chunk name in a setting. All resource fields are possible as placeholder (no template variables).
                    • Thanks Jako, great work!

                      As a resource field can I use the template associated with the resource?
                      For example [[*template]]_m

                      In this way if the resource is associated to template "test" SwitchTemplate will load the template "test_m". Right?