-
Notifications
You must be signed in to change notification settings - Fork 4
Templates
w2w provides a simple template system so you can add your own templates. There are a few rules to go by:
- keep the *.html file naming intact, and in order.
- a style.css should be used, to include other css files, or containing al css rules.
- if you want to include your own .html files read below how to do this.
Below an explanation of which files should be in the template directory, and what you can do with them.
this file is here to keep people from being able to view the contents of the folder.
This is the static page for all other pages, this page can contain the following template variables:
{PAGE_TITLE}* = shows the current page title
{STYLESHEET_LINK} = contains the link to style/template_name/style.css
{TEMPLATE_PATH} = contains the path to style/template_name
{SHOWS_ACTIVE} = contains ' class="active"' if shows page is active
{MOVIES_ACTIVE} = contains ' class="active"' if movie page is active
{LOG_ACTIVE} = contains ' class="active"' if log page is active
{CONFIG_ACTIVE} = contains ' class="active"' if config page is active
{ERROR}* = contains all errors as '<strong style="color:red">error message 1<br />error message 2</strong>
{CONTENT}* = contains all content from other pages
{VERSION}* = contains the version text '<p style="color: #228822; or color: #BC2A4D;"><strong>version message</strong></p>' (maybe changing to class= later)
{L_*} = contains language string from language files
This is the static page for install/config page, input naming, hidden inputs and values cannot and should not change. this page will be included into {CONTENT} in index_body.html
This is the static page if you cannot create a config file, and have to download it, this is the same as the index_body.html file, and should be treated as so, only difference is the form to download the config file.
{S_HIDDEN}* = contains all hidden inputs.
This is a static page and holds all content comming from other pages, this page will be included in index_body.html.
You can only change the h1 part in this file, leave the rest as is.
{HEADER} = contains the name from the page you are on
This is a dynamic page and holds the content for 1 movie which will be used in the movies array to fill {CONTENT} in list_content.html. Forms and inputs names and values should not be changed. This page can contain the following template variables:
{MOVIEID} = contains the movie imdb id
{TITLE} = contains the movie title
{YEAR} = contains the movie year
{MPAA} = contains the movie rating
{BANNER} = contains the banner images, should be preceded by images/
{PLOT} = contains the movie plot in dutch
{GENRE} = contains all genres for the movie
{RUNTIME} = contains the movie runtime
{BREAK}* = contains '</div><div class="col span_1_of_2">' or ''
<form id="postform{MOVIEID}" action="index.php?mode=movies&checkin=true" method="post"> = is needed to checkin at trakt
<a href="?mode=movies&getfanart={MOVIEID}"> = is needed to update the banner
This is a dynamic page and holds the content for 1 show which will be used in the shows array to fill {CONTENT} in list_content.html Forms and inputs names and values should not be changed. This page can contain the following template variables:
{HOOK_BEFORE_CHECKIN} = contains all hooks from plugins for hook_before_checkin
{TVDBID} = show tvdb id
{HOOK_AFTER_CHECKIN} = contains all hooks from plugins for hook_after_checkin
{SHOW_NAME} = show name
{MESSAGE} = contains the message for trakt
{TRAKT_ID} = show trakt id
{DESCRIPTION} = show description from sickbeard
{EPISODE} = episode nr in format 1x00
{NAME} = contains the name of the episode
{BREAK}* = contains '</div><div class="col span_1_of_2">' or ''
<form id="postform{TVDBID}" action="index.php?mode=shows&checkin=true" method="post"> = needed to checkin on trakt
<a href="?mode=shows&getfanart={TVDBID}"> = needed to refresh banner
<a href="?mode=shows&getbanner={TVDBID}"> = needed to get sickbeard banner
This is a static page containing the log page which will be included in index_body.html Forms and inputs names and values should not be changed. This page can contain the following template variables:
{LEVEL} = containing the log level
{CONTENT} = containing the error log
Contains all style rules or all included css files.
You can include your own template files by including them in the above files, for instance you can create a index_body.html file and do this:
<!-- INCLUDE overall_header.html -->
{ERROR}
{CONTENT}
<!-- INCLUDE overall_footer.html -->
now, you can create a overall_header.html containing the upper layout of your template, and a overall_footer.html containing the lower layout of your template and even put {VERSION} in there.