WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: thombaker on December 16, 2008, 11:18:46 PM

Title: Installing template failed (solved)
Post by: thombaker on December 16, 2008, 11:18:46 PM
Hi to all people here.
This is my first post here and first i want say
WB is a very great cms among so much others i've tested...
But... i got some trouble with installing templates.
First i try installing a modified copy of "allcss" with wb/addons/templates
Result was my template didn't appear in the template lists.
The reason was 2 mistakes i've made.

1. The value of the variable $template_directory in info.php of a template must
    match the directory name where the templates files resides. In other words:
    If you want change the dir. name you must change the value of $template_directory,
    otherwise template install will fail but without an visible errormessage. :|
2. Another pretty mistake i've made was an double single quote in the info.php:
    $template_description = 'The best Template  >i''ve<  ever made.' :roll:
    result: No installation of my template and the template lists in the backend
    were suddenly shorter!! :-o and all without errormessages :roll:
But no reason for panic, after fix my typos all imported templates appears again and my
template too. (without errors :-D)
I hope i can help to save some time finding errors :-)

Happy baking to all



Title: Re: Installing template failed (solved)
Post by: Ruud on December 16, 2008, 11:38:49 PM
Obviously the $template_directory will reflect the directory name where the template will be installed.
A good explanation on how to create an install package for templates is found here (http://help.WebsiteBaker.org/pages/en/advanced-docu/designer-guide/creating-a-wb-template.php#anker3) in the WB help pages.

Overwriting existing templates can be done, but you will need to use the version variable in a correct way.
The ALLCSS template has a default version of 2.6. Setting it to 2.7 or 3.0 will overwrite the old version.
When the version was not changed, the installer will not install. (it is already there)

The info.php is a piece of PHP code. It must follow the standard PHP rules on single and double quotes.
If you want a single quote in your template description (or name), just create the string within double quotes.
Code: [Select]
$template_description = "The best Template  >i've<  ever made."; would have worked fine.

Happy Baking to you too..
Title: Re: Installing template failed (solved)
Post by: thombaker on December 18, 2008, 07:40:55 PM
Thanks very much, Ruud, for your explanations :-)