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:

Add image:
atom/add
Image archive:
admin/content/atoms

Language and translation

See also these resourcws:

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:

Many verbs that end in -ize or -yze in US English should use proper British English. (See: Oxford dictionaries.)

These should use "z":

$ 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:

Custom types:

Fields

Scald

When Scald and Scald Image is enabled, two taxonomy vocabularies are created:

  1. Authors – scald_authors.
  2. Scald tags – scald_tags

The first of this may also be used for for guest blogger bylines:

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.

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.)

  1. The Anonymous publishing allows non-authenticated users (anonymous role) to post.

  2. 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.
  3. 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].