WS.WebTV: General considerations for editing WS.WebTV templates (Advanced Customization).
support, ws.webtv, advanced, customization, create, channel, template
WS.WebTV uses the "jQuery" Javascript framework.
If you are going to use scripts based on jQuery , keep in mind that it is not necessary to include it into the templates <head> section because it is already included.
jQuery version:
WS.WebTV supports, and has been verified, up to jQuery 1.9.1 and jQuery UI 1.10.3; however, it still used version 1.7.2 because it is faster than 1.9.1, in several cases, specially on Internet Explorer.
jQuery 2.0: We have not verified jQuery 2.0 support because it does not support Internet Explorer 7 and 8, and we have dedicated a great effort to achieve a good compatibility with old Web browsers.
¿How to switch from jQuery 1.7.2 to 1.9.1?
You must edit the WebTV configuration file ( config/Config.inc.php ) and add the following lines:
$JQUERY_URL = '//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js';
$JQUERY_UI_URL = '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js';
You must always use Absolute URLs for referencing images, CSS and Scripts.
1. Referencing a file located in a folder of the current theme:
{k.dir_public_frontend}/{k.theme}/folder/file_name.ext
Example. Referencing an image located in the images folder of the current theme:
<img src="{k.dir_public_frontend}/{k.theme}/images/my_image.jpg" alt="" >
2. Referencing a file located in a folder of the current theme' style:
{k.dir_public_frontend}/{k.theme}/folder_{k.style}/file_name.ext
Example. Referencing an image located in the images folder of the current theme's style:
<img src="{k.dir_public_frontend}/{k.theme}/images_{k.style}/my_image.jpg" alt="" >
File inclusion: {k.incl.file.tpl}
If you want to include a template, into another template, use this label. Example:
{k.incl.inc_header.tpl}
The previous will include the content of the file "inc_header.tpl" into the template which contains the label.
NOTE: Only one nesting level is possible.
Current user data fetch: {k.user.data_index}
For fetching current user data. Example:
{k.user.alias}
The previous will echo the current user Alias. Example of possible labels:
{k.user.id}, {k.user.login}, {k.user.alias}, {k.user.name}, {k.user.surname}, {k.user.email}, {k.user.country}, {k.user.telephone}, {k.user.web}
NOTE: These labels are normally used within session conditional blocks (see bellow).
User session conditional block (Logged In): <kuser:loggedin> ... </kuser:loggedin>
Any HTML code enclosed within these tags will be removed if the user is not logged in. Example:
<kuser:loggedin>
<a href="#">Log Out</a>
</kuser:loggedin>
The "Log Out" link, of the previous example, would only appear if the user is logged in.
User session conditional block (Logged Out): <kuser:loggedout> ... </kuser:loggedout>
Any HTML code enclosed within these tags will be removed if the user is logged in. Example
<kuser:loggedout>
<a href="#">Log In</a>
</kuser:loggedout>
The "Log In" link, of the previous example, would only appear if the user is logged out.
User session conditional block (Access Level): <kaccesslevel:n> ... </kaccesslevel:n>
These tags are mainly used on the Back-End templates. When the current user's Access Level is lower than the specified into these tags, the HTML code enclosed within them will be removed.
The condition is: current user's Access Level "number" must be equal or lower than "n" (a lower number means a higher Access Level)
Example:
<kaccesslevel:1>
<a href="#">Configuration</a>
</kaccesslevel:1>
The previous "Configuration" link will only appear if current user is Admin or Webmaster.
Access Levels: 0 = Webmaster | 1 = Admin | 2 = Author | 3 = Contributor | 4 = Paid Subscriber | 5 = Free Subscriber. More info.
CMS data fetch: {k.html.data_index}
This label is used to fecth data from the CMS; these labels can be different between pages. Example:
{k.html.channel_title}
The previous will echo the Channel title when used on the Channel template.
NOTES:
-
These labels can not be renamed as they reflect indexes of internal data structures. However, you are free to remove (or reposition/duplicate) any if you require it.
- (Since WS.WebTV 3.1 R50) In case that you need to include one of these labels in a Back-End data field (for example, in the "Additional HTML Code" fields / <head> and </body> sections) then you must include them as {html.data_index} , otherwise they are very likely to get lost or replaced after saving.
Loop block: <kloop:loop_name> ... </kloop:loop_name>
All the HTML code enclosed within these tags will be processed by the CMS, in a loop. Inside the loop there can be any of the CMS labels detailed in this document as well as loop-specific labels like {k.loop.value.data_index}
NOTE: These tags/labels can not be renamed as they reflect indexes of internal data structures. However, you are free to change all the HTML code inside the loop block; or even remove (or reposition) the whole block, if you require it.
Special Front-End labels: {k.html.fe_tpl_file}, {k.html.fe_action} (Since WS.WebTV V3.1 R50)
If you need to print the current Front-End template file name, you can use the labels {k.html.fe_tpl_file} or {html.fe_tpl_file} .
If you need to print the current Front-End action/section, you can use the labels {k.html.fe_action} or {html.fe_action} .
Language pack text fetch (Front-End): {k.lang.fe.language_pack_text_index}
This label is used to fetch text from the Front-End language pack. Example:
{k.lang.fe.published_by}
The previous will echo the text "Published By", if English language is selected for the Front-End.
NOTE: The index must exist in the language pack in order to get its associated value.
Language pack text fetch (Back-End): {k.lang.be.language_pack_text_index}
This label is used to fetch text from the Back-End language pack. Example:
{k.lang.be.clips}
The previous will echo the text "Clips", if English language is selected for the Back-End.
NOTE: The index must exist in the language pack in order to get its associated value.