Tag Archives: template

A2Billing template selection

This post follows on from a previous one about a Twitter Bootstrap template for A2Billing – http://sysadminman.net/blog/2012/a2billing-template-using-twitter-bootstrap-4557

It’s not immediately obvious how to select a different template in A2Billing. It only comes with a single template called ‘default’

To create another template you just create a new folder at the same level as ‘default’ and put your files in it. So, depending on your folder structure, you would end up with something like this for the customer interface and a template called ‘bootstrap’ –

/var/www/a2billing/customer/templates/default
/var/www/a2billing/customer/templates/bootstrap

To dynamically select that template you can pass a variable in the URL. The variable is called ‘cssname’ so the new URL would look something like this – https://livedemo.sysadminman.net/?cssname=bootstrap

Once the website visitor uses the site by passing the cssname this selection is stored in a session variable, meaning when they visit again they will get this template. To switch back you can just pass the ‘default’ template name – https://livedemo.sysadminman.net/?cssname=default

The only 2 ways I’m aware of setting this option as the default would be to either replace the default template, or change the line that sets it in the code. This is in –

./a2billing/common/lib/customer.defines.php

and is set here –

$_SESSION["stylefile"]='default';

A2Billing template using Twitter Bootstrap

A2Billing is a call billing application for Asterisk. It comes with 3 separate web interfaces – Admin, Customer and Agent. These interfaces look a little dated and I often get asked by people how to modify them, especially the Customer interface.

Titter Bootstrap is a framework for creating web pages. It gives them a standard look and feel, and also prevents some of the issues that can be caused by different browser incompatibilities.

Yesterday I was contacted by someone who is looking at creating a Twitter Bootstrap template for A2Billing. Here is an example of the default customer login page, with the new template alongside it –

a2billing_customer_original_logina2billing_customer_bootstrap_login

He is working on extending the template to more of the interface pages, and am sure would appreciate any feed back or suggestions.

You can find the github pages for the project here – https://github.com/UlisesArcidiacono

and a blog post about the project here – http://devaleph.com/blog/a2billing-customer-template-customization