Page 1 of 1

repeated {content} fields

Posted: Thu Jan 11, 2007 9:46 am
by pumuklee
hi

i want to make a template with many {content} fields
but i want that the cms admin user to have the possibility to specify how many
from cms admin panel

because now when i want to insert for example 3 {content} in the template
i must insert directly this in template somtehing like this

{content block="c1"}
{content block="c2"}
{content block="c3"}

i want to ask that if it exist something like this module or not?

thanks

Re: repeated {content} fields

Posted: Thu Jan 11, 2007 9:56 am
by Dee
pumuklee wrote: i want to ask that if it exist something like this module or not?
There's nothing like that I know of. Normally you would make different templates and have the cms admin user specify the template.

Regards,
D

Re: repeated {content} fields

Posted: Thu Jan 11, 2007 10:05 am
by cyberman
You can try to do it with Smarty ... insert something like this in your template (for every block)

Code: Select all

{content block="c1" assign=c1}
{if $c1 neq ""}
{content block="c1"}
{/if}

Re: repeated {content} fields

Posted: Thu Jan 11, 2007 10:28 am
by pumuklee

Code: Select all

{content block="c1" assign=c1}
{if $c1 neq ""}
{content block="c1"}
{/if}
this solution is for eliminate empty {content} blocks

but i want something like this

contentname = array(name1,name2...)

{foreach item from=contentname}
  {content block="item" assign=item}
{/foreach}

and with the possibility in cms admin area to specify the lenght of the contentname array
or the names of the ontent blocks...

the important is to have the possibility to specify how many {content} element the admin want on the page-dinamically
not to modify the template for this

thanks