Posted: Mon Oct 04, 2004 5:33 am Post subject: Strange syntax in the templates
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?
Posted: Mon Oct 04, 2004 10:28 pm Post subject: Re: Strange syntax in the templates
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:
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