We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42141
    • 73 Posts
    I have the breadcrumbs snippet, but I can't get it to look as my current breadcrumbs sad.

    And with Wayfinder the trouble is that I need to make different submenus with it, but I can't get it to show the subpages, no matter what I do. Basically, with both plugins chunks, TV's and tpl's are difficult for me. I don't quite get the implementation part. I do grasp the concept for chunks and tpl's though...
      • 42450 ☆ A M B ☆
      • 10 Posts
      Tim Butterworth, MODX Ambassador Reply #12, 13 years, 8 months ago
      Just to second the main themes of the discussion here, for a typical website I would typically have 3-4 templates for homepage, content pages in a few styles and contact us.

      But then you will find that lots of HTML code will be common to all of those pages. The head section for instance will be largely similar for each page; google analytics code will be common and the page footer will be the same. Therefore, extract all of these common pieces of HTML code and put them in either chunks or TVs. The key thing is to end up in a situation that says:

      'For anything that appears on multiple pages of my site, should I want to change them, I only have to change the code in one place'.

      There will be times when that can't be achieved, but they should be few and far between. [ed. note: tcbutterworth last edited this post 13 years, 8 months ago.]
        Tim Butterworth, MBA
        MODX Ambassador
        http://www.eecsoftware.com
        • 10208 ☆ A M B ☆
        • 1,780 Posts
        Can you show us all your chunks for Wayfinder, your Wayfinder call, and the css for the menu?

        Try &level=`2` in the call instead of 0.
          Frogabog- MODX Websites in Portland Oregon
          "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
          Having server issues? These guys have MODX Hosting perfected - SkyToaster
          • 3749
          • 24,544 Posts
          Quote from: sophieschoice at Feb 09, 2013, 08:03 AM
          Basically, with both plugins chunks, TV's and tpl's are difficult for me. I don't quite get the implementation part. I do grasp the concept for chunks and tpl's though...

          It's confusing at first, but once you get it, it's really simple. When MODX sees a chunk tag, it replaces it with the contents of the chunk named in the tag.

          When MODX sees a TV tag it replaces it with the value of the TV for the current resource.

          When MODX sees a snippet tag, it replaces it with whatever the snippet returns.

          When a chunk or resource has a placeholder tag, MODX replaces the tag with the value of the placeholder. Those values are usually set by snippets.

          Extras like Wayfinder and Breadcrumbs have a Tpl chunk. For each resources they process, they start with the Tpl chunk, and replace its placeholders with the values from the resource they are currently processing. They add each processed chunk to their output, and when they're done, they return that output -- which replaces the Wayfinder or Breadcrumbs snippet tag.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 42141
            • 73 Posts
            Quote from: frogabog at Feb 09, 2013, 07:22 PM
            Can you show us all your chunks for Wayfinder, your Wayfinder call, and the css for the menu?

            Try &level=`2` in the call instead of 0.

            I don't have chunks for Wayfinder at the moment. I use this call in my template: [[!Wayfinder? &startId=`[[*parent]]` &level=`3`]], but gives me all the childpages from the 'koninklijke families' resource, instead of only the childpages of the page I am on.

            This is want I want to achieve: http://allthingsroyal.nl/koninklijkefamilies/nederland.php

            Modx installation: http://www.allthingsroyal.nl/test3/koninklijkefamilies/nederland/
              • 10208 ☆ A M B ☆
              • 1,780 Posts
              Try:

              [[!Wayfinder? &startId=`[[*id]]` &level=`2`]]
              (edit: oops, sorry not ~id, and not start - stupid froggy typing)
              see the documentation at http://rtfm.modx.com/display/ADDON/Wayfinder

              Are you trying to reproduce the layout in your existing site, or are you moving that to the left sidebar where the wayfinder menu exists right now?

              I'm working with a translated version of your site, and the live version shows a different layout than what shows in an untranslated version of the MODX site.

              If you're looking for the layout that shows the crests for each family, I think you should look at getResources instead. If you want the menu on the left sidebar, then Wayfinder will be your best choice.

              [ed. note: frogabog last edited this post 13 years, 8 months ago.]
                Frogabog- MODX Websites in Portland Oregon
                "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                Having server issues? These guys have MODX Hosting perfected - SkyToaster
                • 42141
                • 73 Posts
                Hi,

                Yes, I want to reproduce the layout from my current website for my Modx-installation, and it's indeed the menu in the left sidebar i want recreate.

                Strange you get a different layout for the pages I linked, might be because not all pictures are in their place yet and the breadcrumbs snippet might have been the source for confusion.

                I have the following call now: [[!Wayfinder? startId=`[[~id]]` &level=`3` &outerTpl=`[[$menu]]']], but my chunk menu is not applied, it seems. That chunk contains this, so it will load the correct CSS: <ul id="avmenu"[[+wf.classes]]>[[+wf.wrapper]]</ul>

                  • 22427
                  • 793 Posts
                   [[!Wayfinder? startId=`[[~id]]` &level=`3` &outerTpl=`[[$menu]]']]
                  The & is missing before startId,
                  it should be [[*id]], not [[~id]],
                  and the single quote should be a backtick:
                   [[!Wayfinder? &startId=`[[*id]]` &level=`3` &outerTpl=`[[$menu]]`]]


                  [ed. note: ottogal last edited this post 13 years, 8 months ago.]
                    • 42141
                    • 73 Posts
                    Thank you, I corrected both mistakes. Now the output of items is correct. But the css still seems not to be loaded.
                      • 22427
                      • 793 Posts
                      I see on your original home page that you want to keep the same side menu also after going to a subpage. So you should not use [[*id]] for the &startId parameter.
                      Instead, use the snippet UltimateParent in the following way:
                      [[!Wayfinder? &startId=`[[UltimateParent? &topLevel=`1`]]` &level=`3` &outerTpl=`[[$menu]]`]]

                      The value needed for &topLevel is depending on your resources tree, so best is to fiddle around a bit to find the correct one.