Personal Video Database

English => Development => Topic started by: wickedinnit on April 20, 2009, 12:26:51 pm

Title: Export to CSV or xml with custom fields
Post by: wickedinnit on April 20, 2009, 12:26:51 pm
Hi ,

i am not great at creating templates. Am wondering how to export to CSV or xml  :

Title
IMDB rating

with custom fields of :

Which HD :
Which Divx :
Title: Re: Export to CSV or xml with custom fields
Post by: rick.ca on April 20, 2009, 08:25:57 pm
In 0.9.9.x, standard fields are accessed using {%value=[field name]}, custom fields with {%value=[custom field name] custom="true"}, where [custom field name] is exactly as specified in preferences—with spaces and no quotes...

{%value=IMDB rating}
{%value=Which HD : custom="true"}

You find most standard field names used in the "Sample" template.
Title: Re: Export to CSV or xml with custom fields
Post by: wickedinnit on April 23, 2009, 11:02:32 am
Thanks Rick but i am still having difficulty.

i have tried this but it doesnt seem to output to xml properly ie the data displayed in my custom field of Which HD :

%OPTIONS%
replace="&<->&amp;"
replace="<<->&lt;"
replace="><->&gt;"
filter="XML Files|*.xml"
encoding="UTF8"
imagepath="images\"
%OPTIONS%
%HEAD%
<xml>
<viddb>
<movies>{%value=200}</movies>
%HEAD%
<movie>
<num>{%value=num}</num>
<title>{%value=title}</title>
<Which HD :>{%value=Which HD : custom="true"}</Which HD :>
</movie>
%FOOT%
</viddb>
</xml>
%FOOT%


My output comes out as :

<movie>
<num>0</num>
<title>1984</title>
<Which HD : ></Which HD : >
</movie>
Title: Re: Export to CSV or xml with custom fields
Post by: nostra on April 23, 2009, 12:40:55 pm
Are you sure you have a space between HD and semicolon?
Title: Re: Export to CSV or xml with custom fields
Post by: rick.ca on April 23, 2009, 06:42:48 pm
...or that there is not a space after the colon in the custom field name?
Title: Re: Export to CSV or xml with custom fields
Post by: wickedinnit on April 29, 2009, 10:36:27 am
hi ,

ok i solved the problem by renaming the custom fields as HD & AVI instead of Which HD : & Which Divx :

Seems the colon affects the exporting to xml!