Customisations, language and translations
This page contains notes about the customisations I (as a rule add) to a new Drupal site, how I translate field names, content types and help texts, and some modules that I find particular useful.
Table of contents
Introduction
[TBA]
Projects
Regulars
Below is a list of contributed projects I use in almost all the sites I build:
- Advanced help
- No configuration.
- CKEditor
- See CKEditor chapter for configuration
- Chaos tool suite
- Views dependency.
- Clear Cache
- No configuration.
- jQuery Update
- Set to latest.
- Scald
- For permissions, see below. See Scald chapter for other configuration.
- Transliteration
- Configuration is located under Configuration » Media » File system, but the default is OK.
- Views
- See Views chapter for configuration
Casuals
For what it is worth, here is the list of module projects that I've found useful enough to keep a note on (and not listed publicly), along with a brief description of each:
- Flexilogin (custom)
- To let users login with alterantive credentials (username, email, phone number).
- Node Convert
- Node Convert adds a menu tab Convert on the node view page, which gives the ability of converting the node from its current node type to another node type. Custom field values may also be converted, or discarded. Also allows bulk conversion of many nodes of the same type.
Permissions
Below are basic permissions to set for various user roles.
Projects marked vith a star (*) are contributed projects.
For an introduction to Drupal's core permissions, see chapter Access control. For contributed projects, see the chapter about the project.
Anonymous and authenticated user
- Contact:
- Use the site-wide contact form
- Filter:
- Use the Filtered HTML text format
- Node:
- View published content (except anonymous on intranets)
- Scald Core: (*)
- Fetch any atom marked as Fetchable
View any atom marked as Viewable - Search:
- Use search
Editor
It is not a good idea to give owners who are not site-builders or developers full administrative powers, as this will give them enough power to shoot themselves in the foot. I usually create an editor role for site owner, and grant this role the following permissions:
- Clear cache:
- Can clear cache
- Contact:
- Use users' personal contact forms
- Dashboard:
- View the administrative dashboard
- Filter:
- Use the
wysiwyg
text format (format created by me for CKEditor). - Node:
- Administer content
Access the content overview page
View own unpublished content
Contenttype: X new content - Scald Core: (*)
- Administer Scald Atoms
Create atom …
Edit own atom
View own atom
Delete own atom - Scald DnD Library: (*)
- Access Scald DnD Library
- System:
- View the administration theme
- Toolbar:
- Use the administration toolbar
Drupal automatically grants all non-anonymous roles the rights granted the authenticated user.
Shortcuts
Add these paths to the global shortcuts:
atom/add
admin/content/atoms
Language and translation
See also these resourcws:
- Drupal.org Content style guide (DO:CSG).
- Microsoft.com: Microsoft writing style guide (MS:WSG).
As a site builder, I typically enhance the site from the GUI. Names and help texts for content types fields often need to be translated into Norwegian using the the GUI. The translations I use are recorded here to facilitate reuse. This section also makes clear how I should spell certain English words for consistency.
English spelling
British english spelling should always be used.
Specific terms:
- Use: “checkbox”, not “check box” (MS:WSG).
- Use: “email”, not “e-mail” [e.mail] (DO:CSG).
- Use: “online”, not “on-line” (DO:CSG).
- Use: “webmaster”, not “web master” (DO:CSG, Google lists 192 million vs 5 million).
- Use: “web page”, not “webpage” (DO:CSG).
- Use: “web server”, not “webserver” (DO:CSG).
- Use: “website”, not “web site” (source).
Many verbs that end in -ize or -yze in US English should use proper British English. (See: Oxford dictionaries.)
- alphabetise
- analyse
- capitalise
- composerise
- computerise
- customise
- finalise
- familiarise
- italicise
- maximise
- normalise
- optimise
- organise
- realise
- recognise
- serialise
- utilise
These should use "z":
- /customize
- /localize
- drupalize.me
- parameterize
- resize
- size
$ grep -r "ize" . | egrep -v '(\/customize||\/localize|parameterize|size|drupalize\.me)
Basic translations
In the translations below, machine name is rendered using monospaced font, human name in quotes, “T:” before translated help text. There are also some notes about usage on a separate line (in English).
Content types
Core types:
article
: “Artikkel”. T: Bruk Artikkel for vanlige artikler som skal vises kronologisk (nyeste øverst) på forsiden av nettstedet.
Use this for news sites and single user blogs.blog
: “Blogginnlegg”/“Innlegg”. T: Blogginnlegg/Innlegg vil dukke opp kronologisk på forsiden og samlet på forfatterens bloggside/egen side, og på hovedsiden for blogger/innlegg.
Use this for multi user blogs. Use the alias “Innlegg” if your authors don't want to be bloggers.book page
: “Bokside”. T: Ikke bruk denne (må være aktivert av tekniske grunner).page
: “Infoside”. T: Denne innholdtypen er for grunnleggende sider (ikke nyheter) med grunnleggende informasjon som «Om oss» og «Personvernerklæring».
Custom types:
link
: “Lenke”. T: Bruk Lenke til å registrere lenker til eksterne nettsteder. Etter at en lenke er registrert vil den automatisk bli vist på lenkesiden.wikipage
: “Wikiside”. T: Bruk Wikiside til å lage sider som fungerer ome en wiki. Det innebærer bl.a. at andre enn eieren kan redigere dem.
Do not display author and date information.
Fields
title
: “Overskrift”.body
: “Innhold”.field_tags
: “Stikkord”. T: Skriv inn en liste med ord/uttrykk, adskilt med komma, som skal brukes som stikkord som beskriver innholdet.phonefield
: “Mobilnummer”. Skriv inn nummeret til din mobiltelefon (8 siffer, ingen blanke).
Scald
When Scald and Scald Image is enabled, two taxonomy vocabularies are created:
- Authors –
scald_authors
. - Scald tags –
scald_tags
The first of this may also be used for for guest blogger bylines:
scald_authors
: “Gjesteblogger”/“Forfattere”. T: Dersom innlegget er forfattet av en gjesteblogger kan du skrive inn navnet på gjestebloggeren her. Dersom det er data i dette feltet vil det bli brukt som forfatternavn i stedet for brukernavnet. Dersom feltet er tomt vil brukernavnet til den som oppretter blogg-innlegget bli benyttet som byline. / Dersom det er data i dette feltet vil det bli brukt som byline i stedet for brukernavnet. Du kan legge inn flere forfattere skilt med komma. Dersom feltet er tomt vil brukernavnet til den som eier artikkelen/innlegget bli benyttet som byline.- Contexts: ???
passthrough
: “Bruk uendret”. T: For å bruke bildet uten skalering eller beskjæring. Fungerer kun med korte bildetekster.
Email templates
Welcome-email for “Velkommen, ingen godkjenning er påkrevd” when Flexi Login is also installed.
[user:name], Takk for at du registrerte deg på [site:name]. I framtiden kan du logge inn ved å klikke på denne lenken (eller ved å \ kopiere og lime den inn i nettleseren din): [site:login-url] For å logge på må du oppgi følgende informasjon: brukernavn: [user:name] passord: Ditt valgte passord PS: I stedet for brukernavnet kan du enten oppgi epost-adressen du \ registrerte deg med, eller mobiltelefonnummeret ditt.
To add text to the login page, create a custom block with the block
description “Login page text”, place it in a suitable block region, and
show this text only on the page “user/register
”.
Text formats
Filters in square brackets required if format given to untrusted users.
raw_html5
: “Raw HTML5”. No filters. For admins and trusted users who knows HTML, onlywikitext
: “Wiki tekst”. [Limit allowed HTML.] Code filter Markdown. For user manuals. Emulates SE and old Wikipedia.wysiwyg
: “Wysiwyg”. Embedded atoms. Correct … HTML. Wysiwyg
Tags allowed in wikitext
if Limit allowed HTML filter active:
<h2> <h3> <p> <br> <a> <em> <strong> <cite> <blockquote> <code> <pre> <ul> <ol> <li> <dl> <dt> <dd> <img> <table> <tr> <th> <td>
Hardening hacks
Never name the user #1 “Admin”. Pick something a bit more obscure (e.g. “root”).
Fake admin login
A lot of 'bots try to locate the admin interface and it would be
nice to oblige them. However the following hack failed: Place a bogus
admin login page in a directory named
/admin
, then direct 'bots there with the
following RewriteRule:
RewriteCond %{QUERY_STRING} admin [NC] RewriteRule ^ admin [L]
Unfortunately, it also blocked some Drupal admin pages. I need to come ip with a better plan.
Signon and SUP
A high profile website will attract both legitimate and spam users alike. Spam prevention and spam protection tools may limit participation. Below are the strategy that can be used. (Unless the site is really heavy traffic. the first two will do, with no spam prevention tools enabled at level 2.)
- The Anonymous publishing allows non-authenticated users (anonymous role) to post.
- Vistors should be able to register and fully contribute as soon as they've verified their email (spammers almost never verify). I.e. avoid the delay and extra step of admin approval of new accounts. To stop unverified accounts from posting, make sure that the authenticated user is just as crippled as the administrative user. Then create a contributor role and Autoassign role to contributor as soon as the person verifies email. Some restrictions, such as flood control and CAPCHAs may be used.
- To allow the legitimate users to use the site and post content without the annoyances of spam precention tools, give them the confirmed role. May be awarded manually by admin, or by some rules (e.g. 3 non-spam posts).
For invitation sites, use Mother May I.
API
Ensure your PHP memory_limit is set high enough, we've confimed that the following works: memory_limit = 256M
Final word
Last update: 2017-01-06 [gh].