We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21112
    • 156 Posts
    I want to display an icon next to the heading of a ditto generated list, dependent on a TV set "type". The string I want the TV to output isn’t being displayed in the list returned by ditto.

    I created a TV I’ve called ArticleType. It is of the type DropDown List Menu and the current Input Option Values are "doc||offsite-link". The TV is called from the ditto template chunk (please forgive the messy code, still developing the site):

    <div id="articlelink" style="border:solid 1px #306018; border-width:0 0 1px 0; margin:15px 0 0 0; padding:0;">
    <div style="width:40px; float:left; margin:0; padding:0; text-align:right; color:#114160; font-size:12px; font-family:verdana,arial,sans serif; font-weight:bold; text-transform:uppercase;">[+createdon:date=`%b`+]<br /><span style="font-size:22px;">[+createdon:date=`%d`+]</span></div>
    <div style="margin:0 0 0 45px; padding:0 15px 0 15px; border:solid 1px #306018; border-width:0 0 0 1px;">
    <img src="images/articleimages/[+alias+].jpg" alt=" " style="margin:0 0 8px 15px; float:right;" />
    <img src="images/[*ArticleType*].gif" alt=" " border="0" align="absmiddle" />
    <h2><a href="[~[+id+]~]">[+title+]</a></h2>
    <p style="margin:0; padding:10px 0 10px 0;">[+introtext+] <a href="[~[+id+]~]">Read more...</a></p>
    <div style="clear:both;"></div>
    </div>
    </div>
    


    This template is used on the front page where it formats this ditto call:

    [!Ditto? &parents=`41` &display=`3` &depth=`3` &sortBy=`createdon` &sortDir=`DESC` &tpl=`DittoTemplate` !]
    


    The resulting code output by ditto doesn’t contain the [*ArticleType*] string at all. The offending line is output as:

    <img src="images/.gif" alt=" " border="0" align="absmiddle" />
    


    You can see the page for yourself (its state at the time of posting reflected this issue) at: http://www.vicphysics.org/index.php
    Incidentally there are currently other issues on that page that I’m working on, that I do not believe affect this issue.

    Some possibly useful diagnostic info:
    phpinfo: http://www.vicphysics.org/phpinfo.php
    MODx version: 0.9.6
    Ditto version: 2.0.2
    My browser: Firefox 2.0.0.11
    Also happens on: MSIE 7.0.5730.11
    My OS: Microsoft Windows XP v2002 SP2

    Thanks in advance for any help you can offer!
      • 21257 MODX Staff
      • 730 Posts
      Ditto 2.x turns your template variables into placeholders, so the syntax would be: [+ArticleType+]
      If it’s an older Ditto, the syntax would be [+tvArticleType+]

      I’m citing http://wiki.modxcms.com/index.php/Ditto_Placeholders

        Mike Schell
        Lead Developer, MODX Cloud
        Email: [email protected]
        GitHub: https://github.com/netProphET/
        Twitter: @mkschell
        • 21112
        • 156 Posts
        Thanks for the suggestion. I just gave both methods a try, but to no effect. I made sure the files were updating correctly by putting in some junk characters to be rendered, and these were showing up on the front page, but the TV wasn’t getting displayed, as before.
          • 21257 MODX Staff
          • 730 Posts
          Sorry about that. If it’s not a caching problem, and it’s not a matter of document permissions, then I’ll have to defer to someone closer to Ditto.
            Mike Schell
            Lead Developer, MODX Cloud
            Email: [email protected]
            GitHub: https://github.com/netProphET/
            Twitter: @mkschell
            • 21112
            • 156 Posts
            That’s okay, thanks for taking the time to offer a suggestion!