Templates.
From Smart Job Board help
Contents |
Templates
SmartJobBoard software design and layout is based on ‘Templates’ system.
Templates used in the software are built on html and Smarty.
Note: for more information about Smarty vizit www.smarty.net website
Modifying the software Templates you can change the look and feel of the front-end pages the way you need. Templates can be modified via Admin Panel or ftp access.
Note: more information about modifying the software Templates via Admin Panel you can find in the "Edit Templates" section of the Manual.
There are two basic templates in the system called “main.tpl” and “index.tpl”
main.tpl - this template is used for the Homepage structure only.
index.tpl – and this template is used for all secondary front-end pages. In other words – it is used for all pages except the Homepage.
Also to make it more functional for administrator there are another templates located in ‘menu’ folder, in particular: menu / header.tpl, footer.tpl and top.tpl
header.tpl and footer.tpl – these templates are basically used for the structure of the top and bottom parts of pages, so called ‘header’ and ‘footer’ respectively.
Usually ‘header’ and ‘footer’ remain the same for all front-end pages – it is the content of a page which changes.
top.tpl – the template of the top front-end menu. Usually it also remains the same for all pages.
On the picture below you can see the header, footer and top menu of the front-end pages.
Page content…
The header.tpl, footer.tpl and top.tpl were made as separate templates with the purpose of providing a quick and easy way for administrator to modify these font-end components.
In code of the homepage template (main.tpl) you can se the {$MAIN_CONTENT}
The present variable is used to assign the place where exactly on the Homepage certain components will be displayed: e.g. quick_search.tpl (Quick Search form)
In the index.tpl the {$MAIN_CONTENT} variable is used for displaying the content of another templates.
Thus e.g. when a user go to find_jobs page in the index.tpl instead of the {$MAIN_CONTENT} there is another template substituted – which is classifieds / search_form.tpl
Or in My Account of Employers there is the content of the menu / my_account_employer.tpl displayed.
The examples above describe the way all front-end pages basically displayed.
So one front-end page usually consists of several templates. On the picture below you can see the Homepage as an example:
Also there is the so called “white.tpl”. It is used basically for the Print page, to get listing (job/resume) details displayed in the format for printing (without any other design components).
And you can always create your own file.tpl and get it displayed in any needed place of the front-end inserting the following code to the appropriate place in template code:
file=”../menu/newmenu.tpl”} where ‘newmenu’ is the name of the file you created.
Modules
There are certain ‘Modules’ used in the system.
To get the idea of how it all works within the Templates system we’ll review the following example:
Imagine we created the new Static Content via Admin Panel, and its ID is “TEST</span”. And we want this new Static Content to be displayed on the Homepage. For that we will use Modules functionality the following way:
To the main.tpl code we’ll insert:
{module name="static_content" function="show_static_content" pageid="TEST"}
Note: instructions how to insert Modules to template code and other information about them you can find in the “Edit Templates” section of the Manual.
So this Static Content (with ID: TEST) will be displayed on the Homepage only; in the particular place, according to the place you inserted it in the main.tpl
And if you inserted this Static Content in the index.tpl (using the modules function described above) e.g. after the {$MAIN_CONTENT} – then this Static Content will be displayed on all secondary front-end pages below the main content of the page (defined by {$MAIN_CONTENT}) displayed.
The same way you can put the Login (Sign in) form to any needed place of the site homepage. For that you need to use the following pattern:
{module name="users" function="login" template="login.tpl" internal="true"}
Or you may want the Quick Search form to be displayed somewhere else, besides the place it already displayed. Then you will insert in the proper place of a template code the following:
{module name="classifieds" function="search_form" listing_type_id="Job" form_template="quick_search.tpl"}
Smarty
As you already know there is also Smarty code used within the software tempaltes.
This provides administrator with more functional options.
E.g. you want a certain information to be displayed only for Employers and another information to be displayed only for JobSeekers.
For that you will need to use the Smarty code the following way:
{if $GLOBALS.current_user.group.id == “Employer”}
Welcome employer
{elseif $GLOBALS.current_user.group.id == “JobSeeker”}
Welcome jobseeker
{/if}
I.e. in this case there is verification: if a user belongs to Employer User Group, then the system displays: “Welcome Employer” and if belongs to Job Seeker User Group, then “Welcome Job Seeker”
This is an example of the way you can use Smarty to get the system work according to your needs.
Note: more examples and instructions to modify software design and layout you can find in the "Tutorial" section of the Manual.




