Quote from: BobRay at Mar 07, 2010, 11:56 PM
Maybe I’m misunderstanding, but I don’t think any of that will work because it will all be evaluated when the Ditto tag is processed (before any items are retrieved) so all items will get the same Tpl.
The only way I can think of to do it with Ditto is to just refer to the TV in the &tpl parameter:
and then put the actual tpl HTML code in the TV rather than in a chunk.
You asked for an example of this method. I can’t point you to one but let me describe it in more detail, it’s really simple.
The code above goes in the Ditto tag as one of the of the parameters -- exactly as written (unless you use a different name for the TV). I’ve used TvName, but you can name the TV anything you want.
Then, you create a TV called TvName which has the contents of your default Tpl chunk for its default value. IOW, you’ve got a Tpl chunk now (you do, don’t you?), just paste its contents into the TV Default Value field when you create the TvName TV. The Tpl chunk will no longer be used because the code above is telling Ditto to use the contents of the TvName TV as the Tpl.
Then, for the documents that you want to have a different Tpl, you just edit that TV when editing those documents to give them the form that you want.
Hope that makes sense.
@mrhaw: If I’m understanding the OP, there is only one Ditto call on the page but, hopefully, with a different Tpl structure for certain of the documents it retrieves.