DrupalConfiguration

From HerzbubeWiki
Jump to: navigation, search

This page has information about how to configure Drupal in the web browser.


Initial configuration in setup wizard

When you install the site with install.php, the setup wizard provides a final page where you can enter some basic site configuration data. As an example, here's the list of questions/answers for the D8 setup of herzbube.ch.

  • Site name = herzbube.ch
  • Site email address = webmaster@herzbube.ch
  • Site maintenance account
    • Username = admin
    • Password = secret
    • Email address = drupal-admin@herzbube.ch
  • Default country = Switzerland
  • Default time zone = Zurich
  • Update notifications
    • Check for updates automatically = Yes
    • Receive email notifications = Yes


Initial user

In the final step of the setup process you must create an initial user to access the site. I usually give it the name

admin

because the user automatically is assigned administrator privileges. All users created after the first get their registration data by email.


Suggested order of configuration

After the first login with your new admin account, Drupal presents you with a default navigation bar whose main entries are:

  • administer = used to administer and configure the site
  • create content = write news items, articles, etc.

The "administer" menu entry is discussed in detail in the following chapters. I suggest that configuration is made in the following order:

  • activate modules
  • define roles
  • create users and assign roles
  • general site settings
  • menus and navigation
  • blocks
  • categories
  • localization
  • themes
  • other

Probably most important is to activate modules first:

  • because many modules require that users are assigned special privileges if they want to use them
  • and because modules often reveal new configuration options when they are activated; if you have already browsed through the plethora of available options, it is very easy to overlook a new option that suddenly becomes available later on


Modules & Themes

Important: When you install a new version of a module, you must execute update.php.

Modules & themes are highly site-specific. Details are listed on separate pages:


Access control

Overview

This section defines which roles I usually create for a basic Drupal site, and which privileges they get. Roles that are site-specific are documented on the DrupalSites page. Roles that are specific for addon modules (i.e. non-core modules) are documented on the DrupalModules page.

Manage roles and privileges under "Administration > People".


Anonymous user

  • see printer-friendly version
  • access comments
  • post comments
  • post comments without approval
  • search content
  • use advanced search
  • access user profiles
  • view uploaded files


Authenticated user

  • see printer-friendly version
  • access comments
  • post comments
  • post comments without approval
  • search content
  • use advanced search
  • access user profiles
  • view uploaded files


Book writer

  • create book pages
  • create new books
  • edit own book pages
  • outline posts in books
  • create url aliases


Comment admin

  • access administration pages
  • access comments
  • administer comments
  • post comments
  • post comments without approval


File uploader

  • upload files
  • view uploaded files


Node admin

  • access administration pages
  • administer nodes


Page writer

  • create pages
  • edit own pages
  • create url aliases


Story writer

  • create stories
  • edit own stories
  • create url aliases


Taxonomy admin

  • access administration pages
  • administer taxonomy


Hints for specific privileges

Node module:

  • The privileges "revert revision" and "view revisions" are part of the privilege "administer nodes", i.e. a role does not need these privileges if it already has "administer nodes"
  • "administer nodes" allows the role to do the following things:
    • Edit the content of other users' posts
    • Change the state of a post (e.g. promote, demote)
    • Change the configuration of specific node types (e.g. edit the node's workflow, allow/deny comments and attachments)
    • When creating new posts, change the default values of the fields "Authoring information" (author, date) and "Publishing options" (published, create new revision, etc.)


Upload module:

  • "view uploaded files" is required to see files attached to a node


Users

Under "Administration > People", create new users and assign new roles.

Note: the role "node admin" is very powerful and should be assigned sparingly and to trusted users only. So far, I have actually used the role only when I needed to back-date nodes

If the site-wide default time zone has not been configured yet, every user should be assigned his or her own time zone now.


Administration > Configuration

System

Basic site settings

  • Site name = herzbube.ch
  • Email address = webmaster@herzbube.ch
  • It used to be necessary to explicitly enable "clean URLS". This is no longer necessary, clean URLs are now enabled by default. In fact, there is not even a setting anymore that allows to disable them.
  • Under "Error pages", set both the 403 (access denied) and 404 (not found) pages to a blank value. This causes generic error pages to be displayed.


Statistics

  • Count content views = enabled
    • Note: if no change is made on the "access control" page, only the administrator can see the "read counter"


Cron

  • This page displays the URL that can be used to visit from externally run cron jobs (e.g. in order to update the site's search index)


Media

File system

  • It used to be necessary to specify the file system path where files are stored. This is no longer the case in D8. The page merely shows the various paths without allowing the user to change them.


Regional and language

Regional settings

  • Default country = Switzerland
  • First day of week = Monday
  • Default time zone = Europe/Zurich
    • New users will get this time zone
    • I have not noticed any other effects of this settings. Esp. there is no effect on the "posted" date of new nodes - this date is affected by the indivual user's time zone only


Date and time formats

  • Default short date format = d.m.Y - H:i (26.09.2018 - 19:27)
  • Medium date format
    • For herzbube.ch: "D, d M Y H:i" (Wed, 26 Sep 2018 19:29). Reason for this format are dates like "12/11/2018" which might confuse readers as to which is the month and which is the day. The new format displays the month with an explicit short textual representation.
    • For sites in German: "D, d.m.Y H:i" (Di, 12.10.2010 - 20:33). Reason for this format is to provide a Swiss/German localization for these Swiss/German sites.
  • Long date format = l, F j, Y - H:i (Wednesday, September 26, 2018 - 19:28)


People

Account settings

  • Who can register accounts = Administrators only
  • When cancelling a user account = Delete the account and make its content belong to the Anonymous user


CAPTCHA > CAPTCHA settings

  • Default challenge type = reCAPTCHA


CAPTCHA > CAPTCHA Points

  • Add the following CAPTCHA Points:
    • comment_comment_node_bookreview_form
    • comment_comment_node_book_form
    • comment_comment_node_page_form
    • comment_comment_node_story_form
  • The form IDs you enter here are not documented anywhere. Probably the simplest way to find out a form's ID is to look at a page's source code and find a hidden input element named "form_id". The input element's value attribute has the desired form ID. Solution is from this comment on drupal.org.


CAPTCHA > reCAPTCHA

  • Site key = secret
  • Secret key = secret


Content authoring > Text Formats

Full HTML

  • Allow all "writer" roles (e.g. "book writer", "page writer", "story writer") access to this format


Filtered HTML

  • Depending on the site, add the following HTML elements to the list of allowed tags of the "Filtered HTML" input format:
<!--> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <pre> <br>


The comment "element" (<!-->) is important so that authors can insert a <!--break--> element for teaser separation. For details see this Drupal issue. TODO: Not sure if this is still necessary in D8.


Content types

Content/node types can be configured under "Administration > Structure > Content types".

Things that I want enabled on all sites:

  • For all content types, select "Edit" for the content type, select "Submission form settings" and set "Preview before submitting" to "Required" (default is "Optional").
  • For all content types, select "Edit" for the content type, select "Publishing options" and set "Create new revision" to true (already the default).


Menus

Prerequisite modules:

  • Enable the D8 core module "Menu UI" to be able to manage menus.
  • The module "Menu UI" also requires that the D8 core module "Custom Menu Links" is enabled

Drupal knows three special menu types: Primary links, secondary links, and general content navigation links. These three menu types have a special place in Drupal, for instance themes provide special places in their layout where they will display each of the three menu types.

In the "Menus" control page there is an easily overlooked tab "Settings" which can be used to assign a concrete menu to each of the three special menu types. A newly installed Drupal database already has three concrete menus defined and assigned to the three special menu types. The primary links and secondary links menu are empty, while the navigation menu is already filled with useful links.

In Drupal 5 and 6, possibly in later versions also, there is a bug to the effect that if the primary/secondary links menus exist but have no items, an anonymous user will see a link labelled "edit primary/secondary links". In order to disable this link, set

  • menu containing primary links = no primary links
  • menu containing secondary links = no secondary links

Specifics for herzbube.ch, moser-naef.ch and ludenti.ch

  • enable "Primary Links" menu
  • add menu entries for the various node types (see further down under "Menus")


Blocks

Prerequisite modules:

  • Enable the D8 core module "Custom Blocks" to be able to create custom blocks


Custom blocks are created under "Structure > Block Layout > Custom Block Library". Custom blocks must have a block type. Block types can then be configured with custom fields. The basic block just contains a text field that contains the block body text.

Block placement depends on the selected theme! Different themes provide different areas for block placement, but even if two themes provide the same area (e.g. a right column) block placement must be made separately for both themes (if you place a block in the right column of theme 1, the block is not automatically placed in the right column of theme 2).

A block must be enabled for it to become visible.

Important: Blocks have additional properties that can be changed on the configure page (e.g. the user's right to hide/show the block can be enabled/disabled).

Comments about specific blocks:

  • User account menu
    • When logged out this shows a login link, when logged in this shows (among other things) a logout link.
    • Because my sites do not allow account registration, I usually do not want a login link to be displayed to visitors of my site (it could give them ideas)
    • To disable the menu for unauthenticated visitors, go to the menu's block configuration page, then in the "Visibility" section select "Roles", then finally check the "authenticated user" role to restrict the menu to users that are logged in.


Taxonomy

Taxonomy vocabularies are created under "Administration > Structure > Taxonomy".

Suggested vocabularies:

  • Topics
  • Article Styles
  • Software Projects


TODOs for Drupal 8

Site settings

  • Where can I define the number of posts on the main page?

Comment settings

  • Where can I define that previewing comments is required?

i18n

  • Write a section how to make a German website. Start with the various language modules.