We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26503
    • 620 Posts
    Trying to figure out the best way to determine if a resource has children....

    I have a site that uses a left navigation menu if a top level item has children [top of page nav] - what I want to do is display a different chunk if there are no child resources for that item.

    I was thinking using if & some way to determine if wayfinder returns no results... not sure.
    Maybe there is some way to determine with getresource field? iscontainer? or haschildren?

    suggestions?

    -thanks
    -sean
      *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

      Sean Kimball CLP, CLS.
      Technical Director / Sr. Developer | BigBlock Studios
      ._______________________________________________.
      Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
      27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
      phone/fax: 905-426-5525
      • 3749
      • 24,544 Posts
      What version of MODX?
        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
        • 26503
        • 620 Posts
        Its revo 2.1.3 ... but I managed to figure it out... pretty much what I was assuming.

        [[!If? 
        	&subject=`[[!getResourceField? 
        	&id=`[[UltimateParent? &topLevel=`2`]]` 
        	&field=`isfolder` ]]` 
        	&operator=`==` 
        	&operand=`1` 
        	&then=`[[$ShowSubNavigation]]` 
        	&else=`[[$ShowImageInstead]]`
        ]]
        
        


        -sean
          *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

          Sean Kimball CLP, CLS.
          Technical Director / Sr. Developer | BigBlock Studios
          ._______________________________________________.
          Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
          27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
          phone/fax: 905-426-5525