English > Scripts and Templates

trouble using XML template

<< < (2/2)

CAD:
sorry to be a nuff nuff  ;)
i'm trying to limit the no of tags being returned.
this value doesn't have multiple params. I can't find how to pass this to tpl file.

in ptm file i have
<movie>
{%value=tags template="tags.tpl" maxvalues="3"}
...
...
in tags.tpl file i have

--- Code: ---<tag>{%value=tags}</tag>
--- End code ---
nb. i have tried %params=tags, %value=tag, %value=tag, tag, tags, %tags etc.

output from this is

--- Code: ---<tag>{%value=tag}</tag><tag>{%value=tag}</tag><tag>{%value=tag}</tag>
--- End code ---
pls pls hlp. :)

Also would it be possible to have "maxvalues=<value>" understandable under main .ptm file without calling template. Then we can limit no of entries directly from there without having to create a template for every section where we only want to limit the no of entries.
like:

--- Code: ---<movie>
<director>{%value=directors maxvalues=2}</director> or
<tags>{%value=tags maxvalues=5}</tags>
....
....

--- End code ---

nostra:
Unfortunately it is not possible with the current version of the plugin to limit number of such values, but I will improve the plugin in this regard in the next version.

nostra:
Wait, my answer was regarding your suggestion: <tags>{%value=tags maxvalues=5}</tags>

The other way using aditional template files should work:
in the main template:

--- Code: ---{%value=tags template="pages\tags.tpl" maxvalues="3"}
--- End code ---
in pages\tags.tpl:

--- Code: ---<tag>{%value}</tag>
--- End code ---

CAD:
Thanks Nostra - You're awesome  :D

This works a treat when you know what variables go where  ;)
for benefit of others I have:

--- Code: ---<movie>
{%value=tags template="tags.tpl" maxvalues="3"}
...
...
--- End code ---
In main export plugin.
and
--- Code: ---%HEAD%<tag>%HEAD%{%value},%FOOT%</tag>%FOOT%
--- End code ---
in the called .tpl file.

output looks like:

--- Code: ---<movie>
<tag>Rancher,Marshal,New Mexico,</tag>
--- End code ---
;D

Navigation

[0] Message Index

[*] Previous page

Go to full version