Personal Video Database

English => Support => Topic started by: kmickeletto on October 07, 2010, 01:35:25 am

Title: [SOLVED] Issue with maxvalues on Export
Post by: kmickeletto on October 07, 2010, 01:35:25 am
I am trying to limit how many actors are included during an export to XML.  I have read and everything points to what I have tried but it still doesn't seem to work.  Can anyone point me in the right direction?

Code: [Select]
<actors>{%value=actors template="actors.ptm" maxvalues="3"}</actors>
I have also tried...
Code: [Select]
<actors>{%value=actors maxvalues="3"}</actors>
Currently my actors.ptm file looks like this...
Code: [Select]
%HEAD%<actor>%HEAD%
<name>{%param=name}</name>

%FOOT%</actor>%FOOT%
Title: Re: Issue with maxvalues on Export
Post by: kmickeletto on October 07, 2010, 02:12:30 am
I was able to figure it out...

Code: [Select]
<actors>{%value=actors template="pages\actors.ptm" maxvalues="3" params="full"}</actors>
actors.ptm
Code: [Select]
%HEAD%%HEAD%
{%param=name},
%FOOT%%FOOT%

I get an extra comma at the end of the string of actors, but I guess I can live with it.  Anyone know how to trim the last one?
Title: Re: [SOLVED] Issue with maxvalues on Export
Post by: svenne on October 09, 2010, 12:26:20 am
Hi kmickeletto!

Here's the (or a) trick to trim the last comma:

Code: [Select]
<actors>{#StringReplace '{%value=actors template="pages\actors.ptm" maxvalues="3" params="full"}' ', [ENDLIST]' ''}</actors>
actors.ptm (all in one line):
Code: [Select]
%HEAD%%HEAD%{%param=name}, %FOOT%[ENDLIST]%FOOT%