We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22656
    • 121 Posts
    Having been heavily developing in modx - using chunks & snippets, I thought perhaps the workflow could be slightly improved for developers by making calls to chunks/snippets clickable?

    So, rather than

    • Open Page
    • Locate snippet & tpl name on page
    • New tab (this is the way I do it), open manager, click elements
    • Scroll down to find respective snippet, or ctrl+f to find snippet
    • Clik to open

    instead do this?

    • Open page
    • Locate snippet & tpl name
    • right click snippet - "edit this snippet in new window/same window"
    • right click chunk "edit this chunk in new window/same window"

    Or,
    have the "design view" button amongst top right controls,
    once clicked, the page will be rendered, however,
    All tvs, snippets & chunks will be wrapped in an extra div, with a little tag at the top outlining the snippet/chunk name. Also make this tab clickable with "edit this chunk/snippet" as above.

    This would allow very quick editing, especially when there are a LOT of chunks/snippets to browse through. Using categories is great however after a certain threshold you still end up with loads of categories, which have to be opened to see whether the item is in there or not.
    Search is also good, however me as a user usually resorts to browsing through the resource tree to find what I want as I am familiar with the structure.
    Above would give modx a "dreamweaver" - like editing capability, which most novices would find intuitive.
      • 3749
      • 24,544 Posts
      You may know this already, but in Revolution, you can right-click on a snippet, chunk, plugin, or template in the tree at the left and select "Quick Update." That will let you edit the element in a pop-up window without losing your place in the Manager.

      I do like your "design view" idea, though I suspect that it would be fairly difficult to implement.


      ------------------------------------------------------------------------------------------
      PLEASE, PLEASE specify the version of MODX you are using.
      MODX info for everyone: http://bobsguides.com/modx.html
        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
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        You would need some Javascript to parse left of the click position checking for the first valid tag opener, ignoring any ! character, determine the element type from that, and take the text from there to the first ? or the first closing tag to determine the element's name. It would just exit quietly if it finds closing tags first when parsing left. Then do some AJAX stuff to get the element's ID and an editing form, then pop up a window for the editing. Could probably even access the appropriate element type's MODx editing forms. That's pretty much what I did when I added the "create new category" button for the tree menu bar. The trick was in getting the scope correct. "this" can be awfully ambiguous.

        Of course, this would mean the javascript parser would run any time there was a right-click anywhere in the resource editing page, checking to see if it's in an appropriate form field. What about TVs or the summary field? I suppose it could run in any text or textarea field.

        Since the "Quick Update" feature in the Tree is so handy, I don't see any great rush to implement such a feature in the immediate future. Although I can see the convenience especially if there are a lot of elements in the Tree and you have to go searching for the one you want to update. [ed. note: sottwell last edited this post 14 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
          • 22656
          • 121 Posts
          mmm, this searching for elements amongst categories is really what gave me the idea.
          i usually organise myself in tabs,1 tab for the page, one for snippet one for chunk. and i can have up to 3 pages (x3 tabs) opened at the same time. Then if some script is big might move it into external editor so code can be collapsed and made sense of.
          I havent tried the quick editing, will try and mix that into the flow see how i get on.

          "Design view" could just be pre-rendered in php on the page? Every "[[" fires an href which is wrapped around the "[[" to make it clickable. I might be foolishly oversimplifying here about something I do not know much about - modx's ui.
            • 22656
            • 121 Posts
            the ability to split frameworks into visual entities is always helpful. If they are interactive all the better.
            following screenshot from firefox's 3d view is a lovely example.
            [ed. note: papachumba last edited this post 14 years, 2 months ago.]