Ditto Placeholders

From MODx Wiki
Jump to: navigation, search


When creating a Ditto template, you put placeholders where you wish the data to go. Ditto has some of its own, plus it carries through every document object variable. (Note: If you wish to use a document object variable directly on a normal page in a normal template, you would use the format [*alias*])

Note: This list is based on Ditto 1.0.x. Some placeholders remain the same in Ditto 2, but others no longer exist. Most notably the "Ditto-Specific TV Method" has been superseded by simply referencing a tv as [+tv+]. Also, if you use the [+summary+] placeholder in Ditto 2 you need to add &extenders=`summary` to your Ditto call.


Contents

Useful Ditto Placeholders

  • [~[+id+]~] - Create a full URL based on the ID. Does not create a link itself. Example:

<h3><a href="[~[+id+]~]">[+title+]</a></h3>

  • [+title+] - Contents of one of document title fields. There's probably an order in which it tries to find a title.
  • [+summary+] - Either introtext in full if set, or the first part of content.
  • [+content+] - Displays the content of the document.
  • [+link+] - Creates a link to the document, with the text "Read more...".
  • [+author+] - The name of the author. Based on createdby.
  • [+date+] - The date, in the set format. Set as createdon by default (editedon & pub_date are options)and follows this format string [1].

Useful Document-Specific Values

  • [+pagetitle+] - The title of the document.
  • [+longtitle+] - The longtitle of the document.
  • [+description+] - The description of the document.
  • [+introtext+] - The summary of the document.
  • [+content+] - The content of the document.
  • [+alias+] - The alias of the page. Used in creating Friendly URLs.
  • [+menutitle+] - The menu title of the document.

Other Document-Specific Values

  • [+id+] - the integer id for the document.
  • [+parent+] - the integer of the parent
  • [+isfolder+] - Integer; true (1) if the document is a folder and false (0) if it is not.
  • [+menuindex+] - the menu index (sort order) integer
  • [+hidemenu+] - Returns 1 (true) or 0 (false) - whether this item will show in the menu or not.
  • [+type+] - Returns a string of either 'document' for pages or 'reference' for links
  • [+contentType+] - Returns string of content type specified in manager Content Type drop down menu.
  • [+published+] - integer declaring publish status (0=no, 1=yes)
  • [+pub_date+] - Date document begins viewability (in seconds since January 1, 1970). Note- when this is set, ['published'] is automatically set to true (1)
  • [+unpub_date+] - Date document ends viewability (in seconds since January 1, 1970). Note- setting this will NOT have any effect on the status of the ['published'] setting
  • [+richtext+] - true (1) or false (0), used to specify if a rich text editor should be used in the manager.
  • [+template+] - integer template id to be used with this content.
  • [+searchable+] - Returns 1 (true) or 0 (false) to designate whether this page content should be searchable.
  • [+cacheable+] - Returns 1 (true) or 0 (false) if this page should be cached. This is set to false by default so dynamic snippets function properly.
  • [+createdby+] - Returns integer id number of user who created content.
  • [+createdon+] - Date (in seconds since January 1, 1970) when the content was created.
  • [+editedby+] - Integer id number of the user who last edited the content.
  • [+editedon+] - Returns date of the last edit (in seconds since January 1, 1970).
  • [+deleted+] - Returns 1 (true) or 0 (false). When true, this document will appear in the recyling bin until the recycling bin gets emptied. At that point, the record is removed entirely from the database (REALLY deleted).
  • [+deletedon+] - Returns date of document deletion (in seconds since January 1, 1970).
  • [+deletedby+] - Returns the integer id of the person who deleted the document.
  • [+donthit+] - True (1) or False (0) to indicate whether or not the page registers in the site statics/user tracking.
  • [+haskeywords+] - True (1) or False (0) to indicate if the document has keywords assignded to it or not.
  • [+hasmetatag+] - True (1) or False (0) to indicate if the document has metatags assigned to it or not.
  • [+privateweb+] - True (1) or False (0) to indicate if the document is private for Web Users or not.
  • [+privatemgr+] - True (1) or False (0) to indicate if the document is private for Manager users or not.
  • [+content_dispo+] - String of 'inline' or 'attachment'. Inline documents are displayed in web browsers. Attachment disposition causes the document to be downloaded to the local machine through the web browser file download dialog box.

Ditto MODx Placeholders

  • [+next+] - next button
  • [+previous+] - previous button
  • [+splitter+] - splitter if always show is 0
  • [+pages+] - page list
  • [+totalPages+] - total number of pages
  • [+start+] - the # of the first item shown
  • [+stop+] - the # of the last item shown
  • [+current+] - the # of current page shown (in Ditto 2.x use [+currentPage+] )
  • [+total+] - the total # of pages
  • [+item[x]+] – rendered output of an individual document

Ditto-Specific TV Method

  • [+tvtemplatevariablename+] – where templatevariablename is the name of your TV - ie add tv to the start (NOTE: In Ditto 2.x you dont need to add tv prefix, i.e. you can use [+templatevariablename+])
Personal tools