-
☆ A M B ☆
- 38 Posts
Hi, MRHAW
Thanks per support
I put:
[[if? &is=`[*mytpl*]:is:1` &then=`@TPL:article`]]
Where [*mytpl*] is my TV and article is my chunck
but occurred this error
Error : Invalid argument supplied for foreach()
-
☆ A M B ☆
- 1,031 Posts
@mrhaw: 'eq' is an alias of 'is'.
@Roca: You have to use the code inside of the Ditto templates, not in the Ditto call. And if you use it inside of Ditto you have to use [+mytpl+] instead of [*mytpl*] because the second one points to the value of mytpl of the current resource (with the Ditto call) and not to the iterated resource by Ditto.
can't you have a listbox-TV 'mytpl' on each of the Resources, with input-options
article=={{article}}||quote=={{quote}}
Than put:
into your Ditto-tpl.
you may also need the &hiddenFields - property with all fields used in your tpls to say Ditto, which fields to catch, because Ditto may not see the placeholders in your chunks.
To stay with Jako's suggestion, you would have
as input-options and
[+mytpl:eq=`article`:then=`{{article}}`:else=`{{quote}}`+]
in your Ditto-tpl
[ed. note: Bruno17 last edited this post 13 years ago.]
Quote from: rocaoliveira at Nov 04, 2013, 08:23 AMHi, MRHAW
Thanks per support
I put:
[[if? &is=`[*mytpl*]:is:1` &then=`@TPL:article`]]
Where [*mytpl*] is my TV and article is my chunck
but occurred this error
Error : Invalid argument supplied for foreach()
Here is what I would try:
[[Ditto? &startID=`3` &tpl=`[!if? &is=`[*mytpl*]:is:1` &then=`mytemplate`!]`]]
OR
[!Ditto? &startID=`3` &tpl=`[[if? &is=`[*mytpl*]:is:1` &then=`mytemplate`]]`!]
Notice you can't do [[snippet? &var=`[[another snippet...