The only way of putting repetative numerical values into templates is either by hard-coding them in or by enabling and using php to do it. I always try to avoid enabling php in templates for security purposes, and hard-coding in for example a drop-down select box with 100 values is never fun.
So i have developed a loop plugin that solves the problem by allowing you to perform loops in your templates. Its a free download here:
A few notes:
1) when using the plugin inside a weblog tag (or query tag), the {count} variable will show the weblog’s {count} variable, you could change yours to something like {loop_count} or {counter}.
2) you might also want to start prefixing your EE Add-Ons
Now let’s see if we can use this plugin to easily create multiple columns of weblog entries
i think the file name and the exp tag should be intuitive so that it is easier to understand when seen in a template. for_loop actually describes it pretty well since three values (initial, limit, increment) have to be set, and i assume most people have heard of a for loop, but maybe not…?
@mark: that really is nitpicking but i’ll change it just for you!!
@mark: that really is nitpicking but i’ll change it just for you!!
So shoot me
Actually just kidding, don’t shoot me please!! I have just always been one to notice spelling mistakes and sometimes I really should just keep my g*b shut. Working in radio advertising it has become a staple part of everyday life for me unfortunately!
I’ll bet I’ve probably made some mistakes in this post anyway so will cower off into the corner now!!
Again, great plugin (shouldn’t this word really be plug-in?) though so thanks for that!
The name being so intuitive is exactly why you should prefix it
Again from the Guidlines:
When your class or filename is a common word, or might quite likely be identically named in another PHP script, provide a unique prefix to help prevent collision. Always realize that your end users may be running other add-ons or third party PHP scripts.
I’m not trying to annoy you, just hoping that all EE devs start prefix their add-ons with a personal prefix like the Guidelines propose.
Most EE devs are already doing this…