We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 436 ☆ A M B ☆
    • 265 Posts
    Hi there,

    This has probably already been answered elsewhere, but I’ve searched the Ditto Wiki, Ditto Documentation and here on the Ditto Forum and I haven’t been able to find an answer...

    I’m trying to create a Ditto call that outputs a different template according to the content of the document; for example, I’ve got a News Column with Articles and Videos, the Articles have a very different template and layout compared to the Videos’ template - how would I do this?

    I’ve tried using TVs (as this user explains: http://modxcms.com/forums/index.php/topic,15761.0.html) and then had a look at PHx but started to get quite confused...


    Some more info
    This is my current Ditto call:
    [[Ditto? &tpl=`d-news-tpl` &startID=`200, 4000` &summarize=`20` &displayArchive=`0` &dateFormat=`%a, %b %d ’%y` &sortDir=`ASC`]]
    where I’m trying to get one template to show for documents under ID 200 and another template to show for documents under ID 4000 - the d-news-tpl chunk goes straight to a TV which isn’t working at all...

      MODX Ambassador for Thailand. Managing Director at Monogon, a web design and development studio based in Bangkok, Thailand. - Follow me on Twitter.
      • 18397
      • 3,250 Posts
      http://mirror3.cvsdude.com/trac/ditto/codebase/ticket/18
      http://modxcms.com/forums/index.php/topic,9165.0.html

      P.S. I had to look at my notes to find those pages, neither Google nor the forum search produced either link.