BlogHarbor Home Page
FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  UsergroupsRSS   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Strange syntax in the templates
 
Post new topic   Reply to topic    BlogHarbor Community Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
pembeci



Joined: 24 Sep 2004
Posts: 24

PostPosted: Mon Oct 04, 2004 5:33 am    Post subject: Strange syntax in the templates Reply with quote

I mean all the {{ .... }} s. I guess it is used for preprocessing which among other things enables saving changes without republishing the whole blog. Is it something home cooked at BlogHarbor or part of some language I am not aware of? I was wondering what can you do with this syntax other than reading a variable, looping and checking if something exists. For instance, can you check a so-called template tag's value and take appropriate action?
Back to top
View user's profile Send private message
john
Site Admin


Joined: 16 Mar 2004
Posts: 3434

PostPosted: Mon Oct 04, 2004 10:28 pm    Post subject: Re: Strange syntax in the templates Reply with quote

The double curly braces are the macro language used in templates on our platform. This is a home-cooked language but the syntax bears resemblance to a number of scripting languages.

One of the purposes of these macros is to substitute certain values at "load time", so that when your page loads we can display information like your blog name or URL dynamically. If you change your Blog Name, for example, you do not have to upate your templates as the new name will be updated automatically as the page loads.

It is also possible to check the value of a variable, and display certain information based on that value. Here is an example of code that checks the value of the username and outputs a Welcome message based on your vistitor's username:

Code:
{{if user.username eq "eminem"}}
   Wazzup double M!
{{elsif user.username eq "beastieboys"}}
   Check-ch-check-check-check-ch-check it out! 
{{else}}
  Hello!
{{/if}}
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Search all BlogHarbor support resources.
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    BlogHarbor Community Forum Index -> General Discussion All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum