We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4673
    • 577 Posts
    Ok, I’ve been pounding my way through this and finally got to the point where I need to ask serious questions that I’m just getting in regards to "how-to"

    I’m trying to port a template, http://openwebdesign.org/viewdesign.phtml?id=2827 it’s the multiflex 1 template.
    I’ve got most of it done. Using Susan’s language cookie snippet and other goodies I’ve found on the forums. Of course I’ll do my best to document this and return it here. I just want to get it close as possible to the original and email the original designer to get an "OK".

    I’m down to 3 templates. 1 main center column, 1 right column + center column and 1 printer friendly template.

    I’ve set up chunks for the right column and would like to call them through 1 single template rather than have about templates for each little difference.

    I’m also trying to figure out the left menuing system. I’m using a cookie but it’s not refreshing with every click of a link. ughhhh

    So, I’d like to:
    assign 2 variables/numbers to a document
    which would then
    be parsed into dropmenu (level limit) AND the other number/variable passed into the TV/Snippet for the right column chunk.

    If you browse through the link above you might get a better idea of what I’m trying to do here since I’m not even sure I understand what I’ve written.

    I’m still developing on my portable so a demo link isn’t availabe yet.
      Tangent-Warrior smiley
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You could use a TV (maybe with @INHERIT?) to set the levelLimit
      [[DropMenu?... &levelLimit=`[*levelLimitTV*] ... ]]


      Very interesting template.
        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
        • 4673
        • 577 Posts
        Hi Susan,

        This along the lines that I’m thinkig but the problem is:
        1.) what is the code for the TV
        2.) can you set value on a per document basis?

        I was also thinking about somehow tie the chunk name call to a parameter for the document but ... if you change to a different language then what do you do?

        Looks like I need to get a demo site up!

        Thanks!
          Tangent-Warrior smiley
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          The TV value would simply be an integer, how many levels do you want in the menu for this document? And yes, a TV’s value can be edited for every document.

          I usually try to figure out what value will be the most commonly used, and set that as the default, so I only need to edit the ones that don’t use that same value. Or, if it can be set for a folder document and all of its children will use the same value, I’ll use @INHERIT for the default.

          What would be nice is something like @CHILDREN, for cases when the parent folder/document needs one value, but all of its children will use another value.

          I’m still not sure what you mean about the side column chunk. Are you using a chunk to hold the content for the entire side column? I use a TV for that as well, just like the [*content*], which is just a default TV. The simple way I do it, the TV just contains chunk and snippet tags, the same as your document’s "content" can. While it can’t contain TV tags itself, the chunk it does contain can have TV tags.

          In fact, I usually do this for every block of content, including the banner/header part of the page. That gives me the flexibility of changing the banner, or either sidebar, for every page, just as I can the [*content*]. So my template will just be the skeleton layout HTML, with a TV in each base <div>...</div> container. I do tend to use a chunk for the footer, though, since it so rarely changes from page to page.
            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
            • 4673
            • 577 Posts
            Hi Susan,

            Could you provide an example? I’m pretty lost on the code part but the methology is getting there!
            Also, could this TV be dynamic?

            Thanks!
              Tangent-Warrior smiley
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Well, for one template I have a TV for the left block menu, it’s input type is textarea, and its default value is
              <div id="leftmenu">
              [!DropMenu?startDoc=`[*parent*]`&levelLimit=`1`!]
              </div>


              Now, in the top level pages I edited the TV:
              <div id="leftmenu">
              [!DropMenu?startDoc=`[*id*]`&levelLimit=`1`!]
              </div>


              So this way each top-level page (they have their own menu across the top) has its documents in its left menu, while each child page has the same menu.

              http://www.alandaniel.co.uk/shells.html
                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
                • 4673
                • 577 Posts
                Thanks for replying your posts are definitely helpful!

                I’m still pluggin away at this. I figured out that I can do one menu for several pages but I workign with a nested folder directory type of situation and most sub-sub-menus are causing the problems. Maybe it’s the way I’m trying to limit the layout to just 2 core templates.

                current menu layout
                ie,
                English
                -->folder 1
                --> folder 2 --> sub-folder A --> document 1, 2, 3

                English -- options page -- content, sidebar, printer sheet --- link 1,2,3,4,5

                top right :: a languge bar that uses each language as a top level folder (no documents in the top level only folders)
                main center menu :: shows pages (errr, folders for English language)
                left column menu :: the actual main navigation menu for anything with the folder which is listed in the main menu

                The template that I’m porting seems to be doing it this way.
                So, I’m trying to eliminate that top 2 and want to start from the sub-folder for page navigation.

                Which means after drilling down to the options page which in reality is sub-folder A so the left column should only be showing documents 1,2,3

                But then once you click on document 1 the menu should expand for that document only showing links 1,2,3,4,5 and also show the other top categories within it’s parent folder (not the top parent -- something like

                content
                - link 1
                - link 2
                - link 3
                sidebar
                printer stylesheet

                (this is thinking I clicked earlier on content)

                ugh ... this is a hard template to be learing from laugh
                  Tangent-Warrior smiley