1. Evo Documentation
      1. Administration
        1. Admin Users
          1. Admin Roles And Groups
          2. Reset your Password - Unblock your User
          3. Why Admin Users, Roles and Groups
        2. Friendly URL Solutions
        3. Moving Site
        4. Taking sites down for maintenance
        5. Upgrading
        6. Web Users
          1. Creating a Web User
          2. Web User Groups and Document Groups
          3. Why Web Users and Groups
      2. Content Editing
        1. Editing Resources
          1. Creating a Resource
          2. Edit a Resource
          3. Move a Resource
          4. Publishing a Resource
          5. Select a Template
        2. Evo Tags
          1. Document Variables
        3. Terminology
        4. The Admin Interface
        5. Who Should Read This
      3. Designing
        1. Adding Chunks
        2. Adding Snippets
        3. Adding Tags
          1. Resource Fields
        4. Cross References
        5. Document Caching
        6. Modifiers
          1. @ Modifiers
        7. Template Basics
      4. Developer's Guide
        1. API Reference
          1. DBAPI
            1. delete
            2. escape
            3. getInsertId
            4. query
            5. select
            6. update
          2. Document Object
          3. DocumentParser Object
            1. addEventListener
            2. changeWebUserPassword
            3. documentContent
            4. documentGenerated
            5. documentIdentifier
            6. documentListing
            7. documentMethod
            8. documentObject
            9. evalSnippet
            10. getAllChildren
            11. getCachePath
            12. getChildIds
            13. getDocumentChildren
            14. getDocumentChildrenTVarOutput
            15. getDocumentChildrenTVars
            16. getLoginUserID
            17. getLoginUserName
            18. getLoginUserType
            19. getManagerPath
            20. getParent
            21. getParentIds
            22. getUserData
            23. hasPermission
            24. isBackend
            25. isFrontend
            26. logEvent
            27. maxParserPasses
            28. minParserPasses
            29. regClientCSS
            30. runSnippet
            31. table_prefix
            32. tstart
            33. webAlert
        2. Chunks
        3. Modules
          1. How to create and run a module from within the Admin Interface
          2. Managing module dependencies
          3. Setting up configuration parameters
          4. Writing the module code
        4. Plugins
        5. Snippets
        6. Template Variables
          1. @ Bindings
            1. (at)CHUNK
            2. (at)DIRECTORY
            3. (at)DOCUMENT
            4. (at)EVAL
            5. (at)FILE
            6. (at)INHERIT
            7. (at)SELECT
            8. What are (at) Bindings
          2. Creating a Template Variable
          3. What are Template Variables
          4. Widgets
            1. DataGrid Widget
            2. Floater Widget
            3. Hyperlink Widget
            4. Marquee Widget
            5. Misc. Widget
            6. RichTextBox Widget
            7. Ticker Widget
            8. Viewport Widget
            9. What are Widgets
      5. Getting Started
        1. About Evo
        2. Basic Installation
    2. Evo Extras
      1. AjaxSearch
      2. AnythingRating
      3. Breadcrumbs
      4. directResize
      5. Ditto
        1. Examples
        2. Extenders
        3. Parameters
        4. Placeholders
      6. DocLister
        1. Examples
        2. Filters
        3. Main Parameters
        4. Notes for Developers
        5. Output Parameters
        6. Processing Before Output
      7. Easy 2 Gallery
      8. eForm
      9. EvoGallery
      10. FirstChildRedirect
      11. Jot
      12. MaxiGallery
      13. multiTV
        1. Examples
        2. Extras
        3. Installation
        4. Module
        5. Snippet
        6. Template Variable
      14. PHx
        1. Custom Modifiers
      15. Quill
      16. tagLinks
      17. TinyMCE
      18. TvTagCloud
      19. Wayfinder
        1. Examples
      20. Weblogin
      21. WebLoginPE
        1. API
        2. Parameters
        3. Placeholders
        4. Typical Errors
        5. Views (Templates)
        6. Working with Forms
      22. YAMS
        1. Configuration
        2. How To
          1. YAMS + Breadcrumbs
          2. YAMS + Ditto
          3. YAMS + Ditto + PHx
          4. YAMS + eForm
          5. YAMS + Jot
          6. YAMS + Snippets
          7. YAMS + Wayfinder
          8. YAMS Custom Multilingual TVs, Chunks, Snippets
          9. YAMS Language Dependent Layout
          10. YAMS Language Flag List
          11. YAMS Language Select Landing Page
          12. YAMS Mime-type Dependent Alias Suffixes
          13. YAMS Multilingual Weblinks
          14. YAMS XML Sitemap
        3. Installation
        4. Language Modes
        5. Language Settings
        6. Placeholders
        7. Setup
        8. Snippet
        9. Technical Details
    3. Evo Tutorials
      1. Extras - How To
        1. Ditto Tutorials
          1. Add Ditto Pagination
          2. Basic RSS feed
          3. Category Tagging with Ditto
          4. Create a Custom Ditto Template
          5. Custom Placeholders
          6. Dropdown Menu with Ditto
          7. Dynamically Show Related Posts
          8. Promote to Home Page
          9. Sort by a date tv
          10. Tagged blogging with Ditto (ex.1)
          11. Tagged blogging with Ditto (ex.2)
          12. Tagging Screencast

Examples

This is a user-contributed Extra. If you find issues or would like more info or help, please contact the author.

A Ditto "image sub menu"

the Ditto call

[[Ditto?
&id=`im[*id*]`
&parents=`27`
&depth=`1`
&hideFolders=`1`
&outerTpl=`image-menu-wrapper`
&tpl=`image-menu-row`
&noResults=` `
&orderBy=`menuindex ASC`
&filter=`id,[*id*],2`
]]

Notes:

  • the 27 in &parents=`27` is the Resource ID of the relevant parent folder
  • &filter=`id,[*id*],2` excludes the current resource from the menu

the outer wrapper template chunk

<div class="grid clearfix">
<ul>
[+wrapper+]
</ul>
</div>

the row template chunk

<li><a href="[~[+id+]~]" title="[+pagetitle+]"[[if? &is=`[+link_attributes+]:!empty` &then=`[+link_attributes+]`]]><img src="[[phpthumb? &input=`[+my-image+]` &options=`w=400,h=280,q=90,zc=1,far=C`]]" alt="[+pagetitle+] image" /><span><strong>[[if? &is=`[+menutitle+]:!empty` &then=`[+menutitle+]` &else=`[+pagetitle+]`]]</strong></span></a></li>

Notes:

  • [+my-image+] refers to a template variable called my-image with input type image
  • the phpthumb snippet is used to create a thumbnail of the my-image image
  • the IF snippet is used to include the menutitle if it is not empty

A Ditto news menu

the Ditto call

[[Ditto?
&id=`page`
&parents=`97`
&depth=`0`
&display=`10`
&hideFolders=`1`
&showPublishedOnly=`1`
&showInMenuOnly=`1` 
&paginate=`1`
&paginateAlwaysShowLinks=`1` 
&outerTpl=`news-menu-wrapper`
&tpl=`news-menu-row`
&noResults=`news-menu-NO` 
&tplPaginatePage=`pagination-page`
&tplPaginateCurrentPage=`pagination-current`
&tplPaginatePrevious=`pagination-prev`
&tplPaginatePreviousOff=`pagination-prevOff` 
&tplPaginateNext=`pagination-next`
&tplPaginateNextOff=`pagination-nextOff`
&orderBy=`pub_date DESC, pagetitle DESC` 
&filter=`news-cat,Latest,7`
]]

Notes:

  • the page in &id=`page` indicates the label added to the page url - eg http://domain.com/news?page_start=10
  • the 97 in &parents=`97 is the Resource ID of the relevant parent folder
  • &paginate=`1` and &paginateAlwaysShowLinks=`1` turns on pagination, so the menu will show on multiple pages
  • the 10 in &display=`10` means that 10 items will show on each paginated page
  • &filter=`news-cat,Latest,7` filters the menu so that only news items that have the "Latest" option selected in the "news-cat" template variable will be included in the results
  • &tplPaginatePage=`pagination-page` is a chunk with content
    <a class="ditto_page" href="[+url+]"><span>[+page+]</span></a>
  • &tplPaginateCurrentPage=`pagination-current` is a chunk with content
    <span class="ditto_currentpage"><b>[+page+]</b></span>
  • &tplPaginatePrevious=`pagination-prev` is a chunk with content
    <a href="[+url+]" class="prev ditto_prev_link" title="previous">◄</a>
  • &tplPaginatePreviousOff=`pagination-prevOff` is a chunk with content
    <span class="prev ditto_prev_off ditto_off">◄</span>
  • &tplPaginateNext=`pagination-next` is a chunk with content
    <a href="[+url+]" class="next ditto_next_link" title="next">►</a>
  • &tplPaginateNextOff=`pagination-nextOff` is a chunk with content
    <span class="next ditto_next_off ditto_off">►</span>

the outer wrapper template chunk

<div class="newsbox">
 [+wrapper+]
</div>
[+phx:if=`[+page_totalPages+]`:el=`1`:then=``:else=`<div class="pager">
  [+page_previous+]
  [+page_pages+]
  [+page_next+]
</div>`+]

the row template chunk

<article class="newsitem">
<h2><a href="[~[+id+]~]" title="[+pagetitle+]">[+pagetitle+]</a> <span>[+pub_date:date=`%B %e, %Y`+]</span></h2>
[+content:is=``:then=``:else=`<p>[+content:word_limit=`50`:striptags+] <span class="more"><a href="[~[+id+]~]" title="read more">more</a></span></p>`+]
</article>

Notes:

  • [+content:word_limit=`50`:striptags+] uses 2 different phx snippets joined in the one call. "word_limit" is used the include only the forst 50 words from the content variable. "striptags" is used to remove any html from the content

the no items template chunk

<p>No current items.</p>

A Ditto menu that adds checkbox options into an eForm form

the Ditto call

[[Ditto?
&id=`ef[*id*]`
&parents=`93`
&depth=`0`
&hideFolders=`0`
&outerTpl=`emailform-menu-wrapper`
&tpl=`emailform-menu-row`
&noResults=` `
&orderBy=`pagetitle ASC`
]]

Notes:

  • the 93 in &parents=`93` is the Resource ID of the relevant parent folder

the outer wrapper template chunk

<div class="wrap clearfix">
 <label>Options</label>
 [+wrapper+]
</div>

the row template chunk

<div class="row">
 <label><input name="options[]" type="checkbox" value="[+pagetitle+]" /><span>[[if? &is=`[+menutitle+]:!empty` &then=`[+menutitle+]` &else=`[+pagetitle+]`]]</span></label>
</div>

A Ditto rss menu

the Ditto call

[!Ditto?
&id=`rss`
&startID=`0`
&depth=`0`
&showPublishedOnly=`1`
&showInMenuOnly=`1`
&outerTpl=`rss-menu-wrapper`
&tpl=`rss-menu-row` 
&orderBy=`editedon DESC, menuindex ASC, id ASC, pagetitle ASC` 
&filter=`template,6,2|template,8,2|id,8,2|id,7,2|id,3,2`
]]

Notes:

  • any resources using templates 6 or 8 are excluded from the results. Resources with id of 7 or 3 are also excluded

the outer wrapper template chunk

<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>[[DocInfo? &docid=`1` &field=`longtitle`]]</title>
<link>[(site_url)]</link>
<description>[[DocInfo? &docid=`1` &field=`description`]]</description>
<ttl>60</ttl>
<copyright>copyright [(site_name)] [[CopyYears]]</copyright>
<language>en-us</language>
<atom:link href="[(site_url)][~88~]" rel="self" type="application/rss+xml" />
[+wrapper+]
</channel>
</rss>

Notes:

  • the DocInfo snippet is used to retrieve data from the home page
  • the CopyYears snippet is used to include the current year
  • the 88 in [(site_url)][~88~] is the Resource ID of the rss page

the row template chunk

<item>
<title>[[if? &is=`[+longtitle+]:empty` &then=`[+pagetitle+] - [(site_name)]` &else=`[+longtitle+] - [(site_name)]`]]</title>
<link>[(site_url)][~[+id+]~]</link>
<guid isPermaLink="false">[(site_url)][~[+id+]~]</guid>
<pubDate>[+editedon:date=`%a, %e %b %Y %I:%M:%S %p %z`+]</pubDate>
<description>[+description+]</description>
</item>

Suggest an edit to this page.