Personal Video Database
English => Development => Scripts and Templates => Topic started by: CAD on August 17, 2009, 06:54:20 am
-
im having trouble creating a template. Hoping soemone can help :)
i have changed latest xml export plugin to call a template file as per http://www.videodb.info/forum_en/index.php?topic=1017.0
if i call the param option, pvd crashes.
XML.ptm contains:
HEAD%
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
%HEAD%
<movie>
{%value=52 template="tpl\actors.tpl param="full"}
<title>{%value=title}</title>
<snip>
in tpl\actors.tpl contains:
%HEAD%<actor>%HEAD%
<name>{%param=name}</name>
<role>{%param=role}</role>
%FOOT%</actor>%FOOT%
if i remove param="full" setting then xml output looks like:
<movie>
<actor>
<name>{%param=name}</name>
<role>{%param=role}</role>
</actor>
any ideas :) anyone :)
-
try
{%value=actors template="tpl\actors.tpl param="full"} instead of {%value=52 ...
-
sorry
try
{%value=actors template="tplactors.tpl param="full"}
didn't work.
In my .ptm file I have
<movie>
{%value=actors template="tplactors.tpl" maxvalues="3" param="full"}
maxvalues works (limits no of entries to 3) IF param="full" is not included, but i don't get any data.
output file looks like:
<movie>
<actor>
<name>{%param=name}</name>
<role>{%param=role}</role>
<name>{%param=name}</name>
<role>{%param=role}</role>
actors.tpl contains:
%HEAD%<actor>%HEAD%
<name>{%param=name}</name>
<role>{%param=role}</role>
%FOOT%</actor>%FOOT%
what am i doing wrong :(
-
Ups, sorry. It should be params:
{%value=actors template="tplactors.tpl" maxvalues="3" params="full"}
-
Yay - this works. :)
Note. For others who have struggled (like me) the options in tpl does not require the "s"
so my .ptm file contains:
<movie>
{%value=actors template="actors.tpl" maxvalues="3" params="full"}
....
....
and the actors.tpl file contains:
%HEAD%<actor>%HEAD%
<name>{%param=name}</name>
<role>{%param=role}</role>
%FOOT%</actor>%FOOT%
NB: the NO "S" in %param :D
-
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
<tag>{%value=tags}</tag>
nb. i have tried %params=tags, %value=tag, %value=tag, tag, tags, %tags etc.
output from this is
<tag>{%value=tag}</tag><tag>{%value=tag}</tag><tag>{%value=tag}</tag>
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:
<movie>
<director>{%value=directors maxvalues=2}</director> or
<tags>{%value=tags maxvalues=5}</tags>
....
....
-
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.
-
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:
{%value=tags template="pages\tags.tpl" maxvalues="3"}
in pages\tags.tpl:
<tag>{%value}</tag>
-
Thanks Nostra - You're awesome :D
This works a treat when you know what variables go where ;)
for benefit of others I have:
<movie>
{%value=tags template="tags.tpl" maxvalues="3"}
...
...
In main export plugin.
and%HEAD%<tag>%HEAD%{%value},%FOOT%</tag>%FOOT%
in the called .tpl file.
output looks like:
<movie>
<tag>Rancher,Marshal,New Mexico,</tag>
;D