aboutsummaryrefslogtreecommitdiffstats
path: root/notes/customisation.pod
blob: a4a5023c4cc5b14fd0c862421b860cb7364741de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
=head1 NAME

Customising FixMyStreet

=head1 ABOUT

This document explains how to tailor the default installation of
FixMyStreet to your requirements, including limiting the geographic
area it accepts queries for and translating the text.

It also includes information about how to change the design.

=head1 TEMPLATES

FixMyStreet uses a cobrand system to implement customisation. There
are two parts to a cobrand: the templates and the cobrand module.

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.

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 change the header and footer
templates.

=head1 CSS

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.

The CSS is structured into two main files:

=over

=item core.css

This contains all the styling for the content of the pages. This should not
need changed unless you are significantly changing the layout of the site.

=item main.css

This contains the CSS for the header and footer as well as the colour scheme.

=back

=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. There is documentation in Default.pm that
explains what all the methods do, where they are used and what they should
return. However, a list of the most common ones to change is:

=over

=item site_title

Returns the name of the site and is used anywhere the name of the site appears.

=item country

The country that the cobrand is used in.

=item allow_photo_upload

Return 0 to disallow photo upload.

=item allow_photo_display

Return 0 to disallow photo display.

=item disambiguate_location

FIXME: Used when geolocating to identify if a report is within the area covered
by the site.

=item geocode_postcode

This is used to check if an address entered on the search form is a valid
postcode and if so it returns the lat/long for that postcode.

=item find_closest and find_closest_address_for_rss

These are used to provide information on th closes street to the point of 
the address in reports and rss feeds or alerts. 

=back

=head1 Translations

The translations for FixMyStreet are stored as gettext files and the
language for a Cobrand is set in the C<set_lang_and_domain> call of
the Cobrand module.