WS.WebTV: Adding a Template (Advanced Customization).
support, ws.webtv, advanced, customization, create, template
A Temaplte is a HTML file which contains the structure of a page (Video Channel, Text Channel -Page-, Clips, Categories, News, Events, etc.).
It is possible to add templates for Clips, Channels, Pages, Categories, News and Events.
The following items allows you to assign different templates individually (by editing the desired item and selecting the template): Channels, Pages, Categories,
News and Events.
Additionally, you can globally override the templates (from Configuration > Appearance) used on:
Clips, Channels and Pages, Categories,
News and Events.
We will explain how to add a Template with an example...
For the example we will add a new Video Channel template we will identify as "My Video Channel Template".
1. Open/Edit the _theme.ini file
The theme file is located in public/frontend/default/_theme.ini
Please note that it is a JSON, plain text, UTF-8, file.
You can use any plain text editor like Notepad, Notepad2, Notepad++, Dreamweaver, etc. to edit it.
...now look for the following section:
"templates" :
{
"channel" : {
"default" : { "title" : "Default" , "enable_widgets" : 1, "file" : "channel.tpl", "file_mobile" : "channel.mobile.tpl" }
},
"text_channel" : {
"default" : { "title" : "Default (no sidebar)", "enable_widgets" : 0, "file" : "page.tpl", "file_mobile" : "page.mobile.tpl" },
"sidebar" : { "title" : "Page with sidebar", "enable_widgets" : 1, "file" : "page_sidebar.tpl", "file_mobile" : "page.mobile.tpl" }
},
"clip" : {
"default" : { "title" : "Default", "enable_widgets" : 1, "file" : "clip.tpl", "file_mobile" : "clip.mobile.tpl" }
},
(...)
2. Add a new entry for your new Template (and save...)
"templates" :
{
"channel" : {
"default" : { "title" : "Default" , "enable_widgets" : 1, "file" : "channel.tpl", "file_mobile" : "channel.mobile.tpl" },
"my_video_channel_template":{ "title" : "My Video Channel Template" , "enable_widgets" : 1, "file" : "my_video_channel_template.tpl", "file_mobile" : "my_video_channel_template.mobile.tpl" }
},
"text_channel" : {
"default" : { "title" : "Default (no sidebar)", "enable_widgets" : 0, "file" : "page.tpl", "file_mobile" : "page.mobile.tpl" },
"sidebar" : { "title" : "Page with sidebar", "enable_widgets" : 1, "file" : "page_sidebar.tpl", "file_mobile" : "page.mobile.tpl" }
},
"clip" : {
"default" : { "title" : "Default", "enable_widgets" : 1, "file" : "clip.tpl", "file_mobile" : "clip.mobile.tpl" }
},
(...)
"my_video_channel_template": is the Template ID. It must not contain any space or special characters.
"title": The Template title.
"enable_widgets": Options 0/1. To enable/disable Widgets on the Template.
"file": Is the HTML template used on the "Desktop" interface.
"file_mobile": Is the HTML template used on the "Mobile" interface.
Tip: For the template files, you can start from one of the existing ones: duplicate the file you want to use as "starting point", and rename it according to what you have entered in the _themes.ini file.
Note: Since the JSON format is very strict, we recommend you to validate the file after performing any modification to it. In order to do this you can use an online validation tool like these.
3. Publish the modified "_theme.ini" file into the server
After publishing the file, when creating or editing a Video Channel, the new template will appear in the Template dropdown.
4. Edit your template files and publish them.
Cache: Disable page caching while editing templates. In order to disable caching go to Configuration > Settings > Caching, and set the "Page cache life" value to 0 (and Save...).
Advice: Always keep track of any modification you make to the WebTV so you can re-apply it after updates or reinstallations.