In this short tutorial we will show you how to fast integrate your HostBill installation’s template to match your website’s look and feel. No advanced html/css skills needed – just some copy/paste and we’re done!
Tools needed:
Lets get started!
I’ll be using free html template from http://www.freelayouts.com/ as a original website, so HostBill will match it look and feel at the end. Template i picked: http://www.freelayouts.com/templates/-Green-and-Plain?preview=true.
STEP 1. Create new template directory
With your FTP client go to /path_to_your_installation/templates and create new folder under it, in this tutorial i will use test_1
STEP 2. Download base template to modify
Any template shipped with HostBill will be good – i’ll used clean template. Copy all templates/clean directory contents to your local machine.
STEP 3. Starting file modification
Note: Only basic HTML knowledge is neccessary to create new HostBill template using old one as pattern. HostBill is also using Smarty template system, so if you have any problem with its advanced syntax refeer to Smarty documentation.
HostBill client area template is divided into few key sections, and for basic integration you should edit only theese:
I assume your website is not divided in many sections and every html file contains all informations to display it properly in web-browser. Same is with our tutorial index.html file (which also have its own stylesheet kept in style.css). It is important for us to understand our website current structure, here is how it looks in our example:
3.1 Modyfying header.tpl
Let’s begin from the top. Leave everything unedited to <body> tag. After it paste new header from current website, change page <h1></h1> to tag {$business_name} taken from HostBill:
<div id=”header”>
<div id=”logo”>
<h1><a href=”#”>{$business_name}</a></h1></div>
<!– end #logo –>
<div id=”menu”>
<ul>
<li><a href=”#”>Home</a></li>
<li><a href=”#”>About Us</a></li>
<li><a href=”#”>Products</a></li>
<li><a href=”#”>Services</a></li>
<li><a href=”#”>Contact Us</a></li>
</ul>
</div>
<!– end #menu –>
</div>
Entire page content in actual hosting website is being kept in <div id=”page”> tag, so lets add it below our newly added header. Note that as with (almost) every html tag we need to close </div> – it will be closed in our footer.tpl.
Every page can contains errors or infos that need to be displayed – this are being handled automatically by HostBill, just add into your template (in header file):
<div id=”errors” {if $error}style=”display:block”{/if}>{foreach from=$error item=blads}<span>{$blads}</span>{/foreach}</div>
<div id=”infos” {if $info}style=”display:block”{/if}>{foreach from=$info item=infos}<span>{$infos}</span>{/foreach}</div>
What about logged users? They should be able to see client-menu only – add it simply with:
{if $logged==’1′}
<div id=”subcontent”>
{include file=submenu.tpl}
</div>
{/if}
Because every page contains sidebar we need to add it in header since its included automatically, after information tags mentioned before I’ve added line:
{include file=sidemenu.tpl}
This will automatically load sidebar menu from separate sidemenu.tpl file.
As shown on image earlier page content is being kept in <div id=”content”> so we end our new header.tpl file with it.
3.2 Modifying sidemenu.tpl
Not much to do here – all we need to change in this case is id property of outer sidebar div from id=”sidemenu” to id=”sidebar” so it will match our new styles
3.3. Modifying footer.tpl
In this file we need to close opened in header.tpl tags, and insert footer navigation/information.
3.4 Modifying style.css
To do it quick and dirty way – get content from your current website stylesheet and paste it at the bottom of style.css in HostBill template – this may create naming collisions, so page may look weird in final result – in order to fix this you should have css knowledge
STEP 4. Uploading files to server & testing template
Upload your modified template files into directory created in previous steps on your server using FTP client (like FileZilla on Windows or GFTP on Linux) .
In order to test your template without changing your HostBill apperance for client go to your HostBill installation in browser, and add param ?systemtemplate=test_1 to your request – where test_1 is directory name under which you stored newly created template.
Image above contains final result of our HostBill template modifications – fast &l cheap wasn’t it? About 20-30 minutes and one coffee. Note that your current website is probably way more complex than free html i used here – if you don’t code html yourself you can always hire sb to do the job right for you – visit our job board on our forum.
Good Luck with your modifications!
December 26th, 2009 at 7:34 pm
I want to quote your post in my blog. It can?
And you et an account on Twitter?
December 29th, 2009 at 4:01 pm
Sure go ahead, twitter account is listed on right-hand menu
January 16th, 2010 at 2:17 pm
Tried copying the code above but the site does not change – is this a change due to 1.0.4?
Thanks
January 16th, 2010 at 7:46 pm
It have been changed, but just a bit, so major concepts in this article will work – where you’d get stuck on?
July 26th, 2010 at 10:21 pm
Would be wonderful if you could update this to reflect the changes in 1.46
Am trying to integrate into a Wordpress theme with little success.
Better yet, give us a step by step dummies guide as to how you integrated here, which is what I am trying to accomplish
March 8th, 2011 at 11:34 am
can be integrated whois hostbill another custom page?
March 8th, 2011 at 5:33 pm
Not sure what you mean? You want to edit whois page template? If so than related template file is checkdomain.tpl
May 27th, 2011 at 7:30 am
[...] We hired new developer to make HostBill integration with current website [...]
July 5th, 2011 at 4:40 am
Hi,
I don’t see the “clean” template under templates ? :s