Page 1 of 1

Re: generate copies of similar tags

Posted: Mon Oct 13, 2014 9:03 pm
by paulbaker
Personally I'd rather work with formatting (= templates) than mess with the kind of code you're posting there.

Consider the module Products. It doesn't have to deal with actual products - in one of my sites my "products" are portfolio items. You can set up fields you need and then can order by whatever field you want, or show just certain categories of items. And just ignore fields like price - that's the beauty of templates, you choose what fields you want to show.

Time spent learning how to drive Products (or the even more flexible ListIt2) is time well spent. I was sceptical at first but once you get to know them you'll be firing them up whenever you see a list of anything.

O0

Re: generate copies of similar tags

Posted: Mon Oct 13, 2014 9:09 pm
by Rolf

Re: generate copies of similar tags

Posted: Mon Oct 13, 2014 10:05 pm
by chrisbt
Totally agree with the above 2 suggestions ... 20 definitely needs a module. I'm sure any editors will thank you also.

However the following will work in the body (not sure about the same for content block declarations

Code: Select all

{for $i=1 to 20}
    {if $nm{$1}}
        //employee i bio
    {/if}
{/for}
Highly recommend checking out ... http://www.smarty.net/docs/en/ Smarty 3 that CMSMS uses has some great features.

Re: generate copies of similar tags

Posted: Sat Nov 01, 2014 9:30 pm
by psy
Totally agree with the above 2 suggestions ... 20 definitely needs a module. I'm sure any editors will thank you also.
Agreed!

Also the content block param MUST be URL friendly, ie no spaces. That's what the label param is for, eg {content block='name_1' label='Name 1'...}