vForums Support > Programming & Coding :: Programming Discussion :: > Templating Systems: Variable / Code Format

Templating Systems: Variable / Code Format - Posted By Ross (admin) on 13th Mar 09 at 11:48pm
Hello Coders, Developers and Programmers,

This question isn't necessarily for vForums. I'm asking partly for a Content Management System I am involved in and partly for future changes to our templating system in use here.

As many will know, the variables used in our current templates (such as mini-profile and info-center) are in the format {variable_name} and the if statements look like {if:variable_name}{/if:variable_name}. But I'd like to hear your thoughts on what format you think looks and works the best? I'd also be interested in hearing views on what other code (if statements, else if, foreach etc) you think should be available as well as any other comments or suggestions you may have.

Re: Templating Systems: Variable / Code Format - Posted By Nick (nickb) on 14th Mar 09 at 6:05am
AHH!! I can't decide!!! {Sad}

I like the current format but there should be more of them added. Like if you have it like this:
Code:
 
  1. We would like to welcome {newest_members:1} to forum.<br />
  2. {if:member}Welcome, You have {new_pms} new PM's and a total of {total_pms} PM's.{/if:member}
 
Now there is only one <br /> in it, but it seems that {newest_members:1} is also like a break. ex: Image

and yeah it's supposed to have "Mage Designs" after new member, but it don't. and the one I am showing you is the "Mage Designs skin." so if you check it out make sure you click on that skin.

http://dmtesting.vforums.co.uk/

But I'm not sure, square would probably be best.

Re: Templating Systems: Variable / Code Format - Posted By Michael (wrighty) on 16th Mar 09 at 2:26pm
Keep it as it is... they're cool ... sleak & easy to notice... What would be cool would be to fix some of the 'minor bugs' with them ... like the one pointed out in the post before this one! {Smile}

Re: Templating Systems: Variable / Code Format - Posted By Ross (admin) on 16th Mar 09 at 11:16pm
 
Keep it as it is... they're cool ... sleak & easy to notice... What would be cool would be to fix some of the 'minor bugs' with them ... like the one pointed out in the post before this one! {Smile}


To fix things like that I need to come up with a decent foreach system and a good if/else system. I did spend some hours today building such a system which will need just a little more testing. It'd enable something like:

<foreach newest_members>
<a href="%newest_member_link%" class="%newest_member_groups%">%newest_member_display%</a>
<if (!foreach_last)>, </if>
</foreach>


But like I say, a system like that will need a little more thought and a little more testing {Smile}

Re: Templating Systems: Variable / Code Format - Posted By ashkir (ashkir) on 17th Mar 09 at 6:22am
I am a fan of { } honestly. Got used to them with YaBB software.

Re: Templating Systems: Variable / Code Format - Posted By (¯`•Stormraven•._) (stormraven) on 23rd Mar 09 at 8:39pm
I think {variable_name} would be good {Smile}

Re: Templating Systems: Variable / Code Format - Posted By GlitchesSocom (ravenelle) on 27th Mar 09 at 2:01am
I like the current {braces}

But I do think we need to make some of the template variables into global ones. If we had full control over all the vforum variables in the templates and for global use it could prove quite useful *hint* *hint* {Cool}