Difference between revisions of "JomSocial Templates"

(Overview)
(Component Template)
Line 3: Line 3:
  
 
==Component Template==
 
==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! <br/>
+
Every decent Joomla Component today has its own template. While this indeed could potentially increase the time or even the cost of the site development - since the Administrator has to adopt numerous templates that have visually the same look - it is the '''only''' proper way to layout the component and that is endorsed by Joomla. Having a component template allows us to divide the '''look''', from the source code, and provides an easy way to customize the visual appeal of the component without worries that our customizations will be lost with component updates.
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===
 
===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''<br/>
+
In theory, component templates should provide the compatibility layer between the two releases in the same branch but, more often than not, this is not the case in practice - especially with a complex component such as JomSocial. JomSocial, at this point, is by its view-structure, is probably the most complex component available at the Joomla Extension Directory and this complexity requires a lot of template files and a lot of '''views'''. To illustrate how complex the JomSocial template structure is, it is enough to look at any other component and see how many views the respective component has, and then come back to JomSocial and try to count the number of views it contains.
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?====
+
===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.<br/>
+
The integrated part of the Joomla MVC framework. The "V" in MVC stands for Views. Basically, every page in Joomla must have its own view that determines how that page is viewed by its visitor.<br/><br/>
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.
+
For example, in JomSocial, there are the Frontpage, Registration, Profile, Group, Search, Event, Photo, and Video Views, etc.. To make things even more complex, every view can be extended with tasks; for example, in profile view, we have tasks to edit, delete, change preferences, set privacy, etc. - and, yes, all these require separate template files to provide the visual output of the features available.

Revision as of 04:05, 8 March 2013

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 has its own template. While this indeed could potentially increase the time or even the cost of the site development - since the Administrator has to adopt numerous templates that have visually the same look - it is the only proper way to layout the component and that is endorsed by Joomla. Having a component template allows us to divide the look, from the source code, and provides an easy way to customize the visual appeal of the component without worries that our customizations will be lost with component updates.

Template Compatibility

In theory, component templates should provide the compatibility layer between the two releases in the same branch but, more often than not, this is not the case in practice - especially with a complex component such as JomSocial. JomSocial, at this point, is by its view-structure, is probably the most complex component available at the Joomla Extension Directory and this complexity requires a lot of template files and a lot of views. To illustrate how complex the JomSocial template structure is, it is enough to look at any other component and see how many views the respective component has, 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. The "V" in MVC stands for Views. Basically, every page in Joomla must have its own view that determines how that page is viewed by its visitor.

For example, in JomSocial, there are the Frontpage, Registration, Profile, Group, Search, Event, Photo, and Video Views, etc.. To make things even more complex, every view can be extended with tasks; for example, in profile view, we have tasks to edit, delete, change preferences, set privacy, etc. - and, yes, all these require separate template files to provide the visual output of the features available.