diff options
Diffstat (limited to 'notes/customisation.pod')
-rw-r--r-- | notes/customisation.pod | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/notes/customisation.pod b/notes/customisation.pod index ffde273cf..9d37845fb 100644 --- a/notes/customisation.pod +++ b/notes/customisation.pod @@ -13,35 +13,35 @@ It also includes information about how to change the design. =head1 OVERVIEW FixMyStreet implements a Cobrand system in order to allow customisation -of the default behavior. The cobrand is made up of a set of templates for -the cobrand and a Cobrand module that contains code that customises the -way the cobrand behaves. There are defaults for both of these so the +of the default behavior. The Cobrand is made up of a set of templates for +the Cobrand and a Cobrand module that contains code that customises the +way the Cobrand behaves. There are defaults for both of these so the Cobrand only needs to override things that are specific to it. Customisations should be implemented like this as this means that any upgrade to FixMyStreet will not overwrite your changes. -The custom when creating a Cobrand is to name it after your site, e.g. -if your site was called FixMyPark then you would call the Cobrand -FixMyPark. +For a cobrand to work then it should have the same name as your site, +e.g if your site is www.FixMyPark.com then your Cobrand should be +called FixMyPark. -The default cobrand is called Default. +The default Cobrand is called Default. =head1 TEMPLATES Templates are found in the templates directory. Within that there are seperate directories for web templates and email templates. Under each -of these there is a directory for each cobrand. In our FixMyPark example +of these there is a directory for each Cobrand. In our FixMyPark example this would be L<templates/web/fixmypark> for the web templates and L<templates/email/fixmypark> for the email templates. -The full set of templates is stored in the default cobrand and if no -equivalent template is found in a cobrand directory FixMyStreet will +The full set of templates is stored in the default Cobrand and if no +equivalent template is found in a Cobrand directory FixMyStreet will use the default template. At a bare minimum you will probably want to copy the header and footer web templates found in L<templates/web/default/header.html> and -L<templates/web/default/footer.html> into your cobrand and make appropriate +L<templates/web/default/footer.html> into your Cobrand and make appropriate changes. The other template you should make your own version of is the FAQ which @@ -49,7 +49,7 @@ is in L<templates/web/default/faq-en-gb.html> =head1 CSS -The CSS is stored in web/css/ under which there are directories for cobrands +The CSS is stored in web/css/ under which there are directories for Cobrands but this is only by custom. The loading of the css is controled by the header templates. Note that FixMyStreet uses sccs files to generate our CSS so by there are no CSS files until L<bin/make_css> has been run. @@ -75,15 +75,24 @@ This contains the CSS for the header and footer as well as the colour scheme. =head1 Cobrand modules Much of the rest of the customisation takes place in the Cobrand modules. These -are automatically loaded according to the current cobrand and can be found in -perllib/FixMyStreet/Cobrands/. There is a default cobrand ( Default.pm ) which -all cobrands should inherit from. A cobrand module can then override any of the -methods from the default cobrand. - -You use the cobrand by listing only your cobrand in the ALLOWED_COBRANDS config -option. The name of your cobrand is the module name in lower case - e.g. if -your Cobrand is C<FixMyStreet::Cobrand::Example> then you should put C<example> -in ALLOWED_COBRANDS. +are automatically loaded according to the current Cobrand and can be found in +L<perllib/FixMyStreet/Cobrands/>. There is a default Cobrand ( Default.pm ) which +all Cobrands should inherit from. A Cobrand module can then override any of the +methods from the default Cobrand. + +FixMyStreet uses the hostname of the current request along with the contents +of the C<ALLOWED_COBRANDS> config option to determine which cobrand to use. +If your Cobrand is listd in <ALLOWED_COBRANDS> and matches the hostname of +the current request then it is loaded. If no Cobrand listed in C<ALLOWED_COBRANDS> +matches then the default Cobrand will be used. + +In our FixMyPark example you would put C<fixmypark> in C<ALLOWED_COBRANDS> and +as long as the hostname of the site contains C<fixmypark> then the FixMyPark +Cobrand will be used. + +This means you can provide multiple Cobrands for the site if you require, e.g. +for providing different languages, and FixMyStreet will use the first match +listed in C<ALLOWED_COBRANDS>. Many of the functions in the Cobrand module are used by FixMyStreet in the UK to allow the site to offer versions localised to a single authority and should |