English > Scripts and Templates

What's the right way to use maxvalues in a template?

<< < (2/2)

daddydave:

In the main template, I have
{%value=actors  maxvalues="3" template="ddlist\actor.ptm"}

In the subtemplate, I have
{%param=name}

This results in me seeing output to the effect of:

--- Quote ---<strong>(IMDB Rating:6.3) Actors: {%param=name}{%param=name}{%param=name}  Director: Robby Grewal</strong>
--- End quote ---

If I change the subtemplate to {%value}, it displays the actors names instead of the {%param=name} code but I am not sure how to get commas in there because the built-in templates seem to have no problems displaying commas in between the actors and I can't figure out how they do it.

nostra:
Adding a comma after {%value} should, actually do the trick.

If you use {%param=name}, then you need to call the field in the main templates with
--- Code: ---params="full"
--- End code ---

daddydave:
Perfect, I was going to ask you if there was anyway to get rid of the last comma without having to use Javascript, but then I decided to use &middot; instead of a comma, so it doesn't matter. Thanks again, Nostra.

Navigation

[0] Message Index

[*] Previous page

Go to full version