SiteGlow Components

As discussed in previous sections, SiteGlow templating engine is StringTemplate (ST). It is a simple, concise, well-supported and free library we recommend to any developer that needs to do any kind of string substitution.

One of the advantages of ST is also one of its biggest drawbacks: it enforces a strict separation of presentation and logic. For our purposes this means that ST can only extract data FROM SiteGlow, but never pass data TO SiteGlow. This is very secure, as ST cannot be used to hack SiteGlow, but it does mean that you, as a designer, cannot control which information SiteGlow provides to you. You are stuck with the ST attributes we provide out of the box.

To overcome this limitation we have decided to extend ST with SiteGlow Components. With these components you can create new ST attributes dynamically. For example, you can create a new ST attribute that contains all of the child Publications that have a ranking of high or above, and then use this list to create a side-menu. Or you can create a new ST attribute tells you if the current publication's title is 'Products', and use this to conditionally make the title red.

SiteGlow Components are used like ST template references, except the are preceeded with sg/ instead of templates/. Like in template refences, you can provide any number of parameters separated by a comma, as with the example below:

$sg/ComponentName( param1="value1", param1="value1", param1="value1", body= { You can use the new ST attributes created by this component here } )$

The pages in this section define the SiteGlow Components you can use in your templates. We believe that with these you will be able to accomplish most of your tasks, but if you need additional functionality you can let us know and we might be able to create a new component just for you.