Author Topic: Export to CSV or xml with custom fields  (Read 10724 times)

0 Members and 1 Guest are viewing this topic.

Offline wickedinnit

  • Member
  • *
  • Posts: 13
    • View Profile
Export to CSV or xml with custom fields
« 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 :

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export to CSV or xml with custom fields
« Reply #1 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.

Offline wickedinnit

  • Member
  • *
  • Posts: 13
    • View Profile
Re: Export to CSV or xml with custom fields
« Reply #2 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>
« Last Edit: April 23, 2009, 11:07:24 am by wickedinnit »

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Export to CSV or xml with custom fields
« Reply #3 on: April 23, 2009, 12:40:55 pm »
Are you sure you have a space between HD and semicolon?
Gentlemen, you can’t fight in here! This is the War Room!

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Export to CSV or xml with custom fields
« Reply #4 on: April 23, 2009, 06:42:48 pm »
...or that there is not a space after the colon in the custom field name?

Offline wickedinnit

  • Member
  • *
  • Posts: 13
    • View Profile
Re: Export to CSV or xml with custom fields
« Reply #5 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!


 

anything