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

    Is there a way to have a template variable show up in the [+content+] placeholder for Ditto?

    Note: I’m not placing the template variable in the Ditto template, as seen here (http://modxcms.com/forums/index.php/topic,6120.0.html)

    I made a simple text TV, and set a value for it in the document itself. When I go to the actual document link, the TV will show, as expected. However, when Ditto is listing the documents, the [+content+] placeholder won’t output the TV. It’s not a problem of truncation, since any text I put after the TV shows up, and trunc=`0` is on.


    Also --- I noticed that the parameters listing for Ditto 2.x doesn’t include the 1.x ones. Is it supposed to be this way? Should I just refer to the two of them?

    Thanks,
    Mike



      • 28042 ☆ A M B ☆
      • 24,524 Posts
      When Ditto outputs the content, it is a direct display of the content; the content is not parsed, it’s taken straight from the database. So any MODx tags will not be processed.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 4385
        • 372 Posts
        I don’t know if you found your solution, but I thought I would put here so the next person would find it.

        &hiddenFields=`myTVinsideContent`



          DropboxUploader -- Upload files to a Dropbox account.
          DIG -- Dynamic Image Generator
          gus -- Google URL Shortener
          makeQR -- Uses google chart api to make QR codes.
          MODxTweeter -- Update your twitter status on publish.
          • 6298
          • 13 Posts
          This template (lastnews) shows the full news item on the home page:

             <div class="ditto_item" id="ditto_item_[+id+]">
                  <h3 class="ditto_pageTitle"><a href="[~[+id+]~]">[+pagetitle+]</a></h3>
                  <div class="ditto_documentInfo">by <strong>[+author+]</strong> on [+date+]</div>
                  <div class="ditto_introText">[+content+]</div>
              </div>



          & show using...

          [[Ditto? &startID=`2`  &removeChunk=`Comments` &tpl=`lastnews` &paginate=`1` &extenders=`summary,dateFilter` &paginateAlwaysShowLinks=`1` &tagData=`documentTags`]] 
            • 1535
            • 84 Posts
            Quote from: bwente at May 20, 2008, 08:14 AM

            I don’t know if you found your solution, but I thought I would put here so the next person would find it.

            &hiddenFields=`myTVinsideContent`

            Thanks, this works nicely. I was planning to further abstract it by putting the content in a chunk as the content is identical except for the TVs.

            But Ditto does not parse a chunk in the content either, is there a similar way to make it parse a chunk?

            A quick rundown of what I am trying to achieve: I am building a page that displays customer endorsements. I have created a container which serves as the displayed document. Inside the container is a separate document for each endorsement. These documents have TV’s for text, logo, image alt text and signature.
            I am using ditto in the container to display the full content from these documents. The &tpl is a chunk with simply [+content+].

            Cheers,

            Andreas