We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34162
    • 1 Posts
    I have been thinking why not add an attribute of raio button for the document at the time of creation to indicated as either it is:
    . Filtered HTML (allow some html tag or bbcode)
    . PHP code (snippet)
    . Full HTML
    . WikiText
    . etc

    In the snippet tab where it lists all the available snippets that can be include into the document why not also include the chunks on the list. The snippet and chunk are the same thing for the purpose of reuse code either it is html or php.

    What do you think?

    Thanks
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Another thing I’ve had in the back of my mind is that the list of snippets available would be much more useful if they were rollover or clickable links with a brief help message, perhaps an argument list and an example of use. I think this would require another field in the snippets table, though, to contain "usage" or something of the sort. Although the existing "description" field could be used, if the snippet authors were consistant in using it.
        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
        • 34162
        • 1 Posts
        It is a great idea Susan!

        Furthermore if the document creation has that attribute then we have an opportunity to consolidate document, chunk, snippet into one resource so that in the resource manager the chunk and snippet tab can be combined into one and/or also can be merge with the document manager for editing.

        Aonther thing is the document manager can now merge with the resource manager since document, chunk and snippet are the same thing with just different attributes.

        What do you think?

        Thanks
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          That would be a major change to the database as well as the parsing engine. It would also complicate the creation of the document tree. I don’t see much of an advantage, either. We WANT there to be a big divide between documents and templates, snippets, etc to keep the content editors away from the presentation and programming parts of the whole. Maybe joining snippets and chunks, with an indication of which type it is to simplify parsing, but I really think the documents should stay out of it. Personally, I like having the (code) snippets separate from the (html) chunks; it helps me keep my site organization clearly separated.

          It could be easier to include chunks and snippets; why not have the available snippet list have a rollover help feature, and when clicked on inserts the snippet at the cursor point? Not much different than clicking on the document tree to select the parent ID.
            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