English > Scripts and Templates
trouble using XML template
CAD:
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:
--- Code: ---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>
--- End code ---
in tpl\actors.tpl contains:
--- Code: ---%HEAD%<actor>%HEAD%
<name>{%param=name}</name>
<role>{%param=role}</role>
%FOOT%</actor>%FOOT%
--- End code ---
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 :)
nostra:
try
{%value=actors template="tpl\actors.tpl param="full"} instead of {%value=52 ...
CAD:
sorry
--- Quote ---try
{%value=actors template="tplactors.tpl param="full"}
--- End quote ---
didn't work.
In my .ptm file I have
--- Code: ---<movie>
{%value=actors template="tplactors.tpl" maxvalues="3" param="full"}
--- End code ---
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:
--- Code: ---<movie>
<actor>
<name>{%param=name}</name>
<role>{%param=role}</role>
<name>{%param=name}</name>
<role>{%param=role}</role>
--- End code ---
actors.tpl contains:
--- Code: ---%HEAD%<actor>%HEAD%
<name>{%param=name}</name>
<role>{%param=role}</role>
%FOOT%</actor>%FOOT%
--- End code ---
what am i doing wrong :(
nostra:
Ups, sorry. It should be params:
{%value=actors template="tplactors.tpl" maxvalues="3" params="full"}
CAD:
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:
--- Code: ---<movie>
{%value=actors template="actors.tpl" maxvalues="3" params="full"}
....
....
--- End code ---
and the actors.tpl file contains:
--- Code: ---%HEAD%<actor>%HEAD%
<name>{%param=name}</name>
<role>{%param=role}</role>
%FOOT%</actor>%FOOT%
--- End code ---
NB: the NO "S" in %param :D
Navigation
[0] Message Index
[#] Next page
Go to full version