JomSocial Templates

Revision as of 03:55, 8 March 2013 by Patricia Schmidt (Talk | contribs)

Overview

JomSocial templates are probably the most important part of the component and, at the same time, the most widely customized as well as most misunderstood facility of the extension; so, in this tutorial, we will try to explain the template's purpose, what does it does, and, also, shed some light on the most common misconceptions.

Component Template

Every decent Joomla Component today have its own template. While this indeed could potentially increase the time or even the costs of the site development as Administrator have to adopt numerous templates to have visually same look, it is the only proper way to layout the component and its endorsed by Joomla!
Having a component template, allows us to divide the look, from the source code, and provides easy way to customize the visual appeal of the component without worries that our customizations will be lost on component update.

Template Compatibility

In theory, component template should provide the compatibility layer between the two releases in same branch but, more often then not, this is not the case in practice, especially with the complex component such jomSocial is. Indeed, jomSocial at this point of time is by its view structure probably most complex component available at the Joomla Extension Directory and this complexity requires a lot template files and a lot of views
To illustrate how complex jomSocial template structure is, it is enough to look at any other component and see how many views the respective component have, and then come back to jomSocial and try to count the number of views it contains.

What are views?

The integrated part of the Joomla! MVC framework. V in MVC stands for Views. Basically, every page in Joomla! must have its own view which determines what page visitor is looking at.
For example, in JomSocial, there are frontpage view, registration, profile, groups, search, event, photo, video views and so on. To make things even more complex, every view can be extended with task, so for example, in profile view we have task to edit, delete, change preferences, privacy, etc... and yes, all these require to have a separate template file to provide the visual output of the features available in the view.