Add new Jobs by block
From Smart Job Board help
Contents |
Below you can find the instructions how to add a new block under/above the 'Jobs by Category' and 'Jobs by City'
by the example of adding 'Jobs by State' block.
Note: To add a different block, for example Jobs by Country, Resumes by City (etc),
follow the given below instructions and use the values appropriate in your case:
I.e. in a case with "Jobs by Country" - you'll need to put 'Country'
where in the instructions below it is said to put 'State'.
Create a new Site Page
Go to Admin Panel -> Tempaltes -> Site Pages -> Add a new User Page link
There will be the "Add a New User Page" form opened. Specify the following parameters there:
1) To the URI field enter /browse_by_state/:![]()
2) Check the "Pass parameters via URI" check box:
3) Enter the desired title of the future block to the Title field (Browse by State)

4) In the Module drop-down list select "classifieds"
5) In the Function drop-down list select "browse"
Leave the "Template" field empty.
6) Then there will be additional fields appeared on the form.
To the very first of them enter "State", which means that the values for the block will be taken from the field with ID 'State':
Leave the rest fields of this kind empty.
7) And then in the very last of them enter "Job", which means that only listings of 'Job' type will be displayed in the block:
'Keywords and 'Descriptions' fields can be filled in if wanted.
Create a new Template via Admin Panel
A new template can be easily created via Admin Panel. Go to Layout and Content >> Edit Templates.
On the opened page you will see the "Add a New Template" form, which you need to use to create a new template:
Template Name - enter a desired name for a new template, make sure to not use space characters, instead you can use '_'
Module Name - here you need to select a module/folder where the new template will be located.
Then press the "Add" button. A new template will be created and will appear in the templates table of the module you selected.
Once the template was created, go to edit this template. Insert the following code and press the "Save" button.
<ul class="browseListing">
{foreach from = $browseItems item = browseItem name=browseItems}
{if $browseItem.count > 0 && $smarty.foreach.browseItems.iteration <= 20}
<li><a class='browseItem' href="{$GLOBALS.site_url}/browse_by_state/{$browseItem.url}/">[[$browseItem.caption]] <span class="blue">({$browseItem.count})</span></a></li>
{/if}
{foreachelse}
<li>[[There are no listings with requested parameters in the system.]]</li>
{/foreach}
</ul>
Create a New Template Via FTP
If version of your software is lower than 3.2 - a new template can be created via FTP. There are several ways to do that. Here is one them:
1) Log in to your site Cpane.
2) Go to File Manager menu.
3) There will be the "File Manager Directory Selection" dialog box opened.
You don't need to select any parameters there, just press the "Go" button:
4) On the opened File Manager page you will see different folders displayed in the tabular format. Make double click on the "Templates" folder:
5) Then on the opened page make double click on the "_System" folder to open it:
6) On the opened page make double click on the "Classifieds" folder:
7) On the top left corner of the opened page you will see the "New File" icon, click on it:
![]()
8) There will be the "New File" dialog box opened. Enter "browse_by_state.tpl" to the New File Name field:
And press the "Create New File" button.
The new file will be created and you will be redirected to the Classifieds folder where you can see all files contained in it.
9) In the list of files you need to find the "browse_by_state.tpl" which you've just created and make the right click on it.
In the list of displayed actions you need to find "Edit" and click on it:
10) There will be the Edit Template page opened where you need to insert the following code:
<ul class="browseListing">
{foreach from = $browseItems item = browseItem name=browseItems}
{if $browseItem.count > 0 && $smarty.foreach.browseItems.iteration <= 20}
<li><a class='browseItem' href="{$GLOBALS.site_url}/browse_by_state/{$browseItem.url}/">[[$browseItem.caption]] <span class="blue">({$browseItem.count})</span></a></li>
{/if}
{foreachelse}
<li>[[There are no listings with requested parameters in the system.]]</li>
{/foreach}
</ul>
And then press the "Save Changes" button in the right top corner:
The changes will be saved and there will be the following message displayed:
Note: the given above code can be also inserted to the browse_by_state.tpl (after it is created) via Admin Panel.
The path is: Templates -> Edit Templates -> Classifieds -> edit browse_by_state.tpl
Edit Homepage template
1) Now you need to insert the code of the Jobs by State block to the Homepage template (main.tpl)
Go to Admin Panel -> Templates -> Edit Templates -> Main -> main.tpl
E.g. you want the new block to appear on the Homepage under the existing Jobs by City block.
Then in the main.tpl code you first need to find the following part of the code that defines the Jobs by City block display:
<h1 class="Category">[[Jobs by City]]</h1>
{module name="classifieds" function="browse" level1Field="City" listing_type_id="Job" browse_template="browse_by_city.tpl"}
Note: Scroll down to find this part of the code, as it is located in the end of the main.tpl code. Or you can also use the "Find" function of your browser (usually it is Ctrl+F key combination)
2) Then right afterJobs by City part of the code mentioned above you need to insert the similar to it code that defines Jobs by State block display.
Here it is:
<br>
<h1 class="Category"><nowiki>[[Jobs by State]]<nowiki></h1>
{module name="classifieds" function="browse" level1Field="State" listing_type_id="Job" browse_template="browse_by_state.tpl"}
</br>
Then press the "Save" button to save the changes you made.
3) That's it. Now you can go to the front-end homepage to review the newly created Jobs by State block, it should look the following way:











