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

    I changed from Etomite to Modx a few months ago and I’m absolutely thrilled by the possibilities.
    But (:))

    I want to have a content block in a sidebar where I can put a block relating to the current page. But if none exists, search it’s parent(s) until a block is found.

    In Etomite there is a snippet called getsidebar to do just that : http://dahlgren.slyip.com/getSidebar.html
    The snippet doesn’t work in MODX and modifying it is beyond my skills.

    This snippet looks for an unpublished child document with a page title of "sidebar".
    If not found, it looks above for an unpublished sibling titled "sidebar".
    If not found, it looks for an unpublished doc adjacent to it’s parent...
    and so-on to the topmost level.

    I’ve been experimenting with TV’s to get this done, but no luck yet.

    Any thoughts?

    Txh!
    • Create a TV for your sidebar, probably a text area. Assign the default value of @INHERIT and you’re done.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me