We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46580
    • 167 Posts
    I'm thinking to a strategy to create custom document type with modx.

    Basically I want to automatically assign a specific template by picking a tag (value) from a specific Tagger (extra) group or a TV value (but I will prefer Tagger as a creation taxonomy tool).

    I created a Tagger group named tx.docType containing tags corresponding to each custom document type I want (name/alias): Audio/
    tx-doctype-audio and Text/tx-doctype-txt.

    -- 1 --

    The first idea is to ask to modx to automatically assign a specific template for each document type by forcing the template selection, overriding the template resource setting :


    if tx.docType = none/tx-doctype-none OR undefined => assign template normally with the modx resource setting template dropdown.

    if tx.docType = Audio/tx-doctype-audio => assign tx-doctype-audio template

    if tx.docType = Text/tx-doctype-txt => assign tx-doctype-txt template

    Next steps :

    - How to get the Tagger (or alternatively a TV) tx.docType value ?
    - how to assign programmatically a template on the front end by checking the tx.docType value with a plugin?
    - how to assign programmatically a template on the back end (by calling a snippet) ?

    Tagger Extra: http://modx.com/extras/package/tagger

    -- 2 --

    The second idea seems to me more simple (no needs to fight with a back-end plugin) :

    Back end : without any TV or Tagger group
    Front end : modx template should be also selected on the front-end for new documents.

    Questions :

    - Where may I find a guide to create documents from front end ?

    - How to add searching & sorting capabilities in order to display documents with specific template setting (i.e. template = tx-doctype-txt, template = tx-doctype-audio etc.)? [ed. note: johnxx last edited this post 12 years, 1 month ago.]
      MODX lover
      -
      Développeur MODX / Webdesign / Solutions web
      • 46580
      • 167 Posts
      Finally found a simple solution with Formit extra (second idea) and hooks.
        MODX lover
        -
        Développeur MODX / Webdesign / Solutions web
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        You also might be able to work with NewsPublisher.
          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