We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44259
    • 8 Posts
    So I have been looking for a good way of creating sidebar blocks and arranging them... And I mean this for end-users who might not be that much savvy to use TVs inside templates and other stuff....

    What I did is this: Every block is actually a resource, with title (block title) and content (block content). In resources tree, I made container called "Blocks", with subcontainers: "Left", "Right" and "DEactivated". Now when a user wants new block on the right side for example, he right clicks the "Right" resource and Create new document there. Save it, and that is one new block for the right side.

    Then in my templates, on the right sidebar part, I use getResources to actually list all the resources that are children of the "Right". Something like:
    [[getResources? &parents=`74` &tpl=`tplBlok` &includeContent=`1` &sortby=`menuindex` &sortdir=`ASC`]]

    tplBlok:
    <div class="block">
    <div class="block-title"><h3>[[+pagetitle]]</h3></div>
    <div class="block-content">[[+content]]</div>
    </div>


    That would sort blocks (resources that are under "Right" parent) by menuindex ASCending. What's cool about this is that now in the tree a user can drag and drop blocks (resources), they can rearrange the order of them and they would be displayed in that order on the live site. For those blocks that we don't want displayed, we simply move them into "DEactivated" container (unlike deleting them, we might need them later). They can also unpublish those blocks, but I like to move them into a special category for better organization.

    What do you think? It isn't perfect, but it's a step closer to being more user friendly than editing templates, TVs, chunks etc... I am looking for even better method though. Something with MIGX maybe? How do you guys do this, when you have to make it so that it is easy for a client? [ed. note: zoran_ last edited this post 13 years, 2 months ago.]
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Or you might try the Asides extra... http://modx.com/extras/package/asides
        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
        • 44259
        • 8 Posts
        Looks like I can't install Asides on MODX 2.2.8 ?
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          That's odd... I'm using it on a site that was originally 2.2.4 and regularly upgraded to 2.2.8, and it's working fine. Probably was accidentally given a version compatibility that doesn't recognize 2.2.x. It says "Requires Revolution 2.1.x or greater" and "Compatible up to Revolution 2.1.x", which doesn't make a lot of sense. You'll have to download it and install it manually, I guess. Come to think of it, if I remember correctly, that's how I installed it some time ago, but I have a 1.1.0-dev version. https://github.com/meltingmedia/Asides/downloads [ed. note: sottwell last edited this post 13 years, 2 months ago.]
            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
            • 24414
            • 45 Posts
            Another nice concept for doing something like this popped up on a blog recently:

            MODX How-to: Creating a sidebar system (That makes clients and coders happy!)