generate copies of similar tags

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Location: Maidenhead, UK
Contact:

Re: generate copies of similar tags

Post 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
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: generate copies of similar tags

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
chrisbt
Dev Team Member
Dev Team Member
Posts: 181
Joined: Sun Sep 05, 2010 6:11 am
Location: Sheffield, UK

Re: generate copies of similar tags

Post 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.
psy
Power Poster
Power Poster
Posts: 463
Joined: Sat Jan 22, 2005 11:19 am

Re: generate copies of similar tags

Post 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'...}
Post Reply

Return to “The Lounge”