Author Topic: [SOLVED] Issue with maxvalues on Export  (Read 6178 times)

0 Members and 1 Guest are viewing this topic.

Offline kmickeletto

  • Member
  • *
  • Posts: 4
    • View Profile
[SOLVED] Issue with maxvalues on Export
« 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%
« Last Edit: October 07, 2010, 06:01:37 am by rick.ca »

Offline kmickeletto

  • Member
  • *
  • Posts: 4
    • View Profile
Re: Issue with maxvalues on Export
« Reply #1 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?

Offline svenne

  • Power User
  • ****
  • Posts: 145
    • View Profile
Re: [SOLVED] Issue with maxvalues on Export
« Reply #2 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%