We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12390
    • 39 Posts
    Hi,

    I was wondering is it possible to use a different template for a document as opposed to the listing page? The design I’m working with has things such as custom date formats (different divs for month, year, day etc etc which I can do with Ditto fine). As far as I know I can’t use the ditto place holders outside of Ditto, so I was wondering whether you can specify the "article" template as a chunk?


    Thanks
      • 27708 MODX Staff
      • 2,502 Posts
      What you do in this case is just create a new MODx template based on your site template just for articles. Ditto just shows serialized content from documents but the documents themselves use a page template.

      Hope this makes sense,

      Jay
        Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
        • 7231
        • 4,205 Posts
        I was wondering is it possible to use a different template for a document as opposed to the listing page?
        Yes. There is no limit to what template you use and you can have several different templates being used in sibling documents.

        As far as I know I can’t use the ditto place holders outside of Ditto, so I was wondering whether you can specify the "article" template as a chunk?
        Not sure if I follow you here. Ditto placeholders are document placeholders from other documents, but in general the placeholders are the same (besides any custom TVs) however you use [+ +] rather than [* *]. If you want to style the content differently according to some value you can use a snippet to do the logic (or install PHx) and use a chunk to store the ’template’.
          [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

          Something is happening here, but you don't know what it is.
          Do you, Mr. Jones? - [bob dylan]
          • 12390
          • 39 Posts
          Sorry I meant use phx outside of Ditto.

          I guess I can tell my users to select a new template everytime they create an article, just was wondering if there was a way of doing it without them having to choose anything.
            • 7231
            • 4,205 Posts
            1) You can use a plug-in to pre-select the template
            2) Use a snippet rather than PHx to do the logic for determining the template
            3) Install PHx as a Plug-in and use it the same way you would inside of Ditto.
              [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

              Something is happening here, but you don't know what it is.
              Do you, Mr. Jones? - [bob dylan]
              • 3749
              • 24,544 Posts
              Quote from: hOtTiGeR at Jan 19, 2009, 02:54 PM

              Sorry I meant use phx outside of Ditto.

              I guess I can tell my users to select a new template everytime they create an article, just was wondering if there was a way of doing it without them having to choose anything.

              By default, docs can get the template of their parent folder, so if you can have the docs created in the appropriate folder, that might solve your problem.
                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