|Use of Templates|
|Written by Sigrid Suski|
SOBI2 has an integrated template system for the appearance of the details view, the V-Cards in the category view and on the search results page and the for add/edit entry form.
For each view there is a separate template file available. These template files can be edited in the SOBI2 administration panel. From the left SOBI2 main menu select "Templates & CSS".
Template ManagerUsing the Template Manager different template packages can be installed. You will find additional template packages in our Download Directory.
Before you install the template package make sure that the folders /components/com_sobi2/templates/ and /administrator/components/com_sobi2/includes/install/ are writeable. For that perform a system check ("About"->"Perform System Check").
To choose another template as the default template, click on the red X. The default template is indicated with a green check.
If you hover over the name of the template package a preview window is shown. It contains a description of the package and a thumbnail image.
Category Dependant Templates
Use different templates for categories to show fields category dependant. That means, you can show different fields for different categories. Also you can use a different appearance (colors, fonts) for each category.
To choose an individual template for a category, edit the corresponding category in the "Entries & Categories" section. At the right bottom there are the category template settings. Select the template to be used for this category. You can change here also other category dependent settings like the number of lines on a page, the number of entries in a line and the number of sub categories shown in a line.
The selected template will be used only for the category for which it is set. It will not be used automatically for sub categories of the category. To use it in the sub categories too, edit the sub category and select the template.
For the V-Cards which are shown after a search is performed always the main default template is used.
If an entry is in more than one category, the details view of this entry is shown with the template of those category which is added first to the category list of the entry. That means, if you want to add an entry to more than one category you should not use this feature.
However, it is not possible to use different add/edit entry form templates. Always the add/edit entry form template of those package is used which is set to default. If the default package does not contain a template file for the add/edit entry form the standard SOBI2 add/edit entry form template is used.
To edit the template files go to the SOBI2 administration panel ("Templates & CSS") or edit the files directly.
The template files are located in the SOBI2 template folder in /components/com_sobi2/templates. The default templates from the installation package are located in the folder /components/com_sobi2/templates/default. Please note that the location of the template files of older SOBI2 versions can be different.The names of the template files cannot be changed. These names are:
To modify the template files, at least HTML skills are necessary. For some extended operations also PHP skills are necessary.
To edit the different template files within the SOBI2 administration panel, choose first the template to be edited at the top of the screen. This does not select the template to be shown on front page. Choose that in the Template Manager or in the category.
See also the description of the template commands for details view and V-card.
|News & Info|
Use of Templates