We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36582
    • 463 Posts
    I would be very grateful if someone could explain what I’m doing wrong!

    I have 2 documents containing the same {{chunk}}

    Both documents display correctly when viewed individually.

    The chunk contains Template Variables [*inThisFormat*].

    I want Ditto to display the 2 documents on a results page. When the results are displayed the documents are identical where they should display the TVs and none of the images (also TV based) show up at all.

    I know I’m doing something very basic wrong - anyone give me a clue?

    Many thanks for all your help so far
      Web site design in Nottingham UK by Chris Fickling http://www.chrisficklingdesign.co.uk
      • 18397
      • 3,250 Posts
      1. What version of Ditto are you using?
      2. Did you set your tvs on the page with Ditto? If so, are you seeing those values or something else?
      3. The best way to display TVs with Ditto is to put them in the Ditto template and use [+tvNameofTV+] (or just [+tv+] if your using Ditto 2)
        • 36582
        • 463 Posts
        1. I’m using Ditto 1.0.2
        2. Not sure what you mean there - I just created a chunk of html and inserted the template variables where I wanted the results to show. I then just put {{chunkname}} in each document where I wanted to show the relevant information - I am seeing the correct values when the individual documents are viewed.
        3. What do you mean by "the Ditto template"

        Thanks for your help
          Web site design in Nottingham UK by Chris Fickling http://www.chrisficklingdesign.co.uk
          • 36582
          • 463 Posts
          Sorry to reply to my own post but I think I’m beginning to understand.

          I am now getting the opposite result in that my page summaries are displaying the articles (documents) perfectly, however when I go to the individual documents TV results do not appear.

          I think this is because I’m now formatting the TVs within the chunk [+likeThis+] and not [*likeThis*].

          So this would indicate to me that I need to ’Ditto-ise’ my documents in some way so that they can display the TVs properly.

          Does that sound reasonable or am I still flailing around in the dark?
            Web site design in Nottingham UK by Chris Fickling http://www.chrisficklingdesign.co.uk
            • 18397
            • 3,250 Posts
            Ok, here is a quick way (not the best per say) to do what you wish


            1. Make a copy of your tv chunk and name it ditto_tvs (or whatever you wish)
            2. Change all of your [+ back to [* in your original chunk
            3. Assuming you are using Ditto 2, add &removeChunk (otherwise its &commentsChunk) = your origional chunk name to your ditto call
            4. Assuming you are using Ditto 2 create a new chunk called ditto_tvs_tpl with the following code:

                <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 [+createdon:date=`%d-%b-%y %H:%M`+]</div>
                    <div class="ditto_introText">[+introtext+]</div>
            {{ditto_tvs}}
                </div>
            


            5. Add &tpl=`ditto_tvs_tpl` to your Ditto call

            That should be it...
              • 36582
              • 463 Posts
              Thanks Mark - I will try this but I’m still confused as to what is happening here. Have I done something fundamentally wrong?
                Web site design in Nottingham UK by Chris Fickling http://www.chrisficklingdesign.co.uk