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

    I´m having some troubles in configuring something in my templates.

    My idea is, with IF Addon, check if a Resource is container... if Yes use a chunk on this resource + child resources...
    if Not, use nothing.

    Any ideas how to do this?

    Snippet call that i´m using:

    [[!If? 
    &subject=`[[*id]]` 
    &operator=`is` 
    &operand=`[[*parent]]` 
    &then=`[[$submenu]]` 
    &else=``
    ]]


    Many thanks in advance
      • 42800 ☆ A M B ☆
      • 9 Posts
      Try this
      [[*isfolder:is=`1`:then=`[[$submenu]]`:else=``]]

      after try this
      [[[[*isfolder:is=`1`:then=`$submenu`:else=``]]]]
        • 16899
        • 284 Posts
        Quote from: viktorminator at May 26, 2013, 11:53 AM
        Try this
        [[*isfolder:is=`1`:then=`[[$submenu]]`:else=``]]

        after try this
        [[[[*isfolder:is=`1`:then=`$submenu`:else=``]]]]

        I tried both and it´s not working!!! Is this because my folder resource is an weblink?

        About Us (if i click on about us link, i´ll be redirected to the welcome page with the below structure)
        -----Welcome
        -----Why Are we special?
        -----Our Aims
        -----Our Teachers
        -----Our History & Traditions

        The about us won´t be visible, because it´s weblink. So i guess it´s better get something like, if resource is child, use this chunk, if not do nothing!!!! What do you think?


        By the way, many thanks by the reply!!!
          • 42800 ☆ A M B ☆
          • 9 Posts
          Quote from: legues at May 26, 2013, 12:17 PM
          The about us won´t be visible, because it´s weblink.
          Pls, check ON your setting "Container" (on "Settings" tab of weblink resource).
          And yes,
          [[*isfolder]]
          - this is for current resource, as long as weblink links you somewhere so this will not work.
          If you use this construction in some chunk to make menu via Wayfinder call you should use [[+isfolder]] (my first example).

          Show me your HTML you need to render? [ed. note: viktorminator last edited this post 13 years, 4 months ago.]
            • 16899
            • 284 Posts
            Quote from: viktorminator at May 28, 2013, 03:31 PM
            Quote from: legues at May 26, 2013, 12:17 PM
            The about us won´t be visible, because it´s weblink.
            Pls, check ON your setting "Container" (on "Settings" tab of weblink resource).
            And yes,
            [[*isfolder]]
            - this is for current resource, as long as weblink links you somewhere so this will not work.
            If you use this construction in some chunk to make menu via Wayfinder call you should use [[+isfolder]] (my first example).

            Show me your HTML you need to render?

            Fist of all many thanks for your help!! You can see a live example here - http://www.internationalprimaryschoolalgarve.com/about-us/welcome.html - The about us (for axample) is a folder containing all the sub items inside. In this situation... about us is just a weblink and folder. I want get a solution for this because i want to avoid templates... i mean if i want to use this template on a top level resource (not beeing container) i want to hide the navigation.

            Sorry about my english!!!
              • 42800 ☆ A M B ☆
              • 9 Posts
              Quote from: legues at May 28, 2013, 04:25 PM
              The about us (for axample) is a folder containing all the sub items inside. In this situation... about us is just a weblink and folder. I want get a solution for this because i want to avoid templates...
              Wellcome
              Make as many templates as you need.
              As far as I get you need this for sidebar menu?
              So why don't you make your sidebar menu with
              [[getResources? &parents=`[[*id]]` &tpl=`link.row.tpl` &depth=`1`]]
              ?
                • 16899
                • 284 Posts
                Quote from: viktorminator at May 28, 2013, 04:36 PM
                Quote from: legues at May 28, 2013, 04:25 PM
                The about us (for axample) is a folder containing all the sub items inside. In this situation... about us is just a weblink and folder. I want get a solution for this because i want to avoid templates...
                Wellcome
                Make as many templates as you need.
                As far as I get you need this for sidebar menu?
                So why don't you make your sidebar menu with
                [[getResources? &parents=`[[*id]]` &tpl=`link.row.tpl` &depth=`1`]]
                ?

                For example!!! Nice one!!! I´ll try this solution!!! Can this work for as Wayfinder on selected menus?
                  • 3749
                  • 24,544 Posts
                    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