We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30215
    • 79 Posts
    Hi, I have just started with modx so all those snippets, chunks and TVs are quite new for me:)

    I would like a sidebar on my page with serveral blocks (or boxes), the sidebar should be same on all pages and the user (customer, not developer) should be able to work with these boxes without any limits. That means create/delete/edit/sort. I have found many howtos about sidebars on this page but all sidebars were more or less static.

    However, after some time I got an idea, but I still have almost no experiences with modx so I am not sure if it is a good solution:
    1) I would create a new document, call it Sidebar and make it folder
    2) I would create few documents inside this folder, every document would represent one box/block
    3) I would hide all these documents from menu
    4) I would use Ditto (or something similiar) to display these articles on the page. In fact, there is no difference between blog page with list of articles and sidebar with boxes
    5) Each article has "index" value, this value would care about order of boxes (works for menus, why not for boxes).

    As user is able to create/delete/edit documents on the web, he would be able to do the same with boxes.

    But I have another obstacle. My current design needs to use different styles for first/last/every second box. As Internet Explorer is not ready to use modern CSS selectors I need to acomplishe this directly in the source code. But as far as I know, Ditto has only one template for all items. I could achieve it in JavaScript or modify Ditto’s source and add few features but as I am not a programming God, I would rather avoid that smiley
      -- sorry for my english, bad teacher smiley
      • 36416
      • 589 Posts
      Quote from: tobice at Oct 28, 2009, 08:38 AM
      But I have another obstacle. My current design needs to use different styles for first/last/every second box. As Internet Explorer is not ready to use modern CSS selectors I need to acomplishe this directly in the source code. But as far as I know, Ditto has only one template for all items. I could achieve it in JavaScript or modify Ditto’s source and add few features but as I am not a programming God, I would rather avoid that smiley

      Easily achievable with [+ditto_iteration+] pseudo TV inside Ditto template, and PHx math modifier:
      http://wiki.modxcms.com/index.php/PHx#math.3D.60calculation.60
        • 30215
        • 79 Posts
        Thank you. Exactly what I have been looking for. smiley
          -- sorry for my english, bad teacher smiley