The Drupal 6 Manual What is a CMS? ............................................................................................................................................. 2 XAMPP and databases .................................................................................................................................. 3 XAMPP interface....................................................................................................................................... 3 Creating a database for a Drupal installation ............................................................................................. 5 Backing up your database and site files ..................................................................................................... 5 Restoring the database / switching servers ................................................................................................ 5 Changing the Drupal admin password in the Database ............................................................................. 7 Changing / setting the ‘root’ password in MySQL.................................................................................... 8 MySQL commands .................................................................................................................................... 8 Installing Drupal ............................................................................................................................................ 9 Drupal administration .................................................................................................................................. 10 Modules: core and contributed .................................................................................................................... 10 Enabling / disabling modules................................................................................................................... 10 Installing / uninstalling contributed modules .......................................................................................... 10 Nodes/content .............................................................................................................................................. 11 Paths / URLs / aliases .............................................................................................................................. 12 CCK (Content Construction Kit) ............................................................................................................. 12 Filefield ................................................................................................................................................ 13 Link ...................................................................................................................................................... 13 Input formats ............................................................................................................................................ 14 Empty pages / Default front page ................................................................................................................ 15 Blocks .......................................................................................................................................................... 15 Menus .......................................................................................................................................................... 16 Nice Menus .............................................................................................................................................. 17 SimpleMenu ............................................................................................................................................. 17 Administration Menu ............................................................................................................................... 17 Taxonomy .................................................................................................................................................... 17 Creating users and setting access levels ...................................................................................................... 18 Modules for easier administration ............................................................................................................... 19 Views: display and search ........................................................................................................................... 20 Views Bulk Operations ............................................................................................................................ 23 Other search options ................................................................................................................................ 24 Images .......................................................................................................................................................... 24 Wiki ............................................................................................................................................................. 25 Books ....................................................................................................................................................... 25 FCKeditor (WYSIWYG) ......................................................................................................................... 25 Table of Contents ..................................................................................................................................... 26 Flexifilter ................................................................................................................................................. 26 Wikitools.................................................................................................................................................. 27 Diff (difference in revisions) ................................................................................................................... 27 Talk .......................................................................................................................................................... 28 Calendars ..................................................................................................................................................... 28 Date .......................................................................................................................................................... 28 Calendar ................................................................................................................................................... 30 Number of files corresponding to tag .......................................................................................................... 32 Printer, email and PDF versions .................................................................................................................. 32 Themes: installing and editing ..................................................................................................................... 32 Default and contributed themes ............................................................................................................... 32 Editing CSS ............................................................................................................................................. 32 Changing your logo ................................................................................................................................. 33 Changing your favicon ............................................................................................................................ 33 Internet resources ......................................................................................................................................... 33
What is a CMS? • • • •
Understanding how a CMS works involves understanding the interaction of the following components o MySQL databases o PHP, CSS (controls layout), HTML A database-driven site design enables the separation of a site’s design and content (e.g. its written content on its web pages), and enables content management systems (CMS) like Drupal to exist. The content is stored in the ‘database’. MySQL is a database management system that contains the site content A PHP file contains the instructions for where to look in the database for site content o Instead of including a website’s content in its HTML files, the information is contained in the database. The HTML files contain PHP instructions to access the database. o Here is a PHP tutorial (however this is beyond what you are likely to need to know):
http://www.tizag.com/phpT/index.php
XAMPP and databases • •
• • • • •
To run Drupal you will need some software like XAMPP XAMPP is an acronym: o X-platform o Apache HTTP Server o MySQL database o PHP and Perl script interpreters XAMPP can be used as a local or internet server Download and install o There are three ‘service’ options: Apache; MySQL and Filezilla. The first two are essential for Drupal Download and install XAMPP After installation visit the following page: o http://localhost/ o This should give you the XAMPP start page. Select your language option Don’t forget that for you to be able to access http://localhost/ you need to have XAMPP running, which may not happen automatically. Open the XAMPP control panel and start Apache and MySql.
XAMPP interface This is what you will find at http://localhost/ (redirected to http://localhost/xampp/)
1
This will take you to phpMyAdmin, where you can administrate your databases
•
This is the phpMyAdmin start page, http://localhost/phpmyadmin/
This icon will allow you to make a MySQL query, which enables you to make changes to the database (advanced)
2
This is a menu containing all your databases. Click on one and you can administrate an individual database
This Icon takes you to the phpMyAdmin homepage (the current page) This bar allows you to create a new database
These are the tables in your database. You can edit many of these yourself via this interface
3
Use this tab once you have created a database and want to import content to it
Use this tab to create a backup file for your database
Use this tab to determine what users have access to this database
This tab deletes the current database
Creating a database for a Drupal installation • • •
To install Drupal you will first need to create a database for it; we will call this ‘drupal’. o During your Drupal installation you will need to enter this name Go to phpMyAdmin (see screenshot 2 above) Type in the name, keep the default ‘collation’ option and click ‘create’
Backing up your database and site files •
•
Backup the database o You need to ‘export’ the drupal database Select the export tab from the horizontal menu in phpMyAdmin (see slide 3 above) I know that these settings work, but I don’t know what many of them mean. In my case they were all already selected by default. • Export o Make sure all of the files in the ‘export’ box are highlighted and that the ‘SQL’ format is selected • Structure o Select: Add AUTO_INCREMENT value o Select: Enclose table and field names with backquotes • Data o Select: Complete inserts o Select: Extended inserts o Select: Use hexadecimal for BLOB • You can then ‘save as file’ o Select: Save as file o Select: Compression – none o Then select ‘go’ to save your database Here is an (low-resolution) instructional video (this also shows how to restore a database) • http://video.google.com/videoplay?docid=2742157386318372444 Backing up your files o In addition to your database you have all of the files for your website in the Drupal root folder, which we will call ‘root’ (see Installing Drupal) o If you want to backup the whole website you must backup both your files and your database
Restoring the database / switching servers •
•
To restore the database o Create a new database, as shown above o Then select the ‘import’ tab from the horizontal menu along the top. o Browse and select the backup file for your database. o Settings (already selected as default in my case): Number of records to skip from start = 0 SQL compatibility mode: NONE o Then select ‘go’ to import your database. Transferring from another server o When transferring from another server you must make sure that the settings in the configuration.php file are the same as those in your database. Configuration.php is in your Joomla root folder. The this information comes from the following forum thread: http://forum.joomla.org/viewtopic.php?f=428&t=269557 • You must check these settings in the configuration.php file o var $user = 'THIS MUST BE THE USERNAME YOU MADE FOR THE NEW SQL NOT THE LOCAL ONE'; o var $password = 'NEW PASSWORD NOT LOCAL ONE'; o var $db = 'FULL MYSQL NAME FOR YOUR HOSTED DB, SOMETIMES HOSTS ADD SOMETHING SO CHECK THIS CAREFULLY';
o
o
var $log_path = 'COMPLETE SERVER PATH TO THIS FOLDER/logs'; var $tmp_path = 'COMPLETE SERVER PATH TO THIS FOLDER/tmp';
Changing the Drupal admin password in the Database Columns Edit icon
Rows
‘users’ table
• •
Values
If you want to change a password via the Drupal interface Access ‘phpMyAdmin’ o http://localhost o Select the ‘drupal’ database (see slide 2) The column on the left will then give you a long list of database tables Of these, select ‘users’ Click on the edit icon for the user whose password you want to change o Passwords are written in a language called ‘MD5 hash’.
o
o o
You can convert your password to MD5 hash online using various websites, or use the following code instead admin = 21232f297a57a5a743894a0e4a801fc3 Then change your password again afterwards using the Drupal backend These instructions were taken from http://docs.joomla.org/How_you_reset_an_administrator_password%3F
Changing / setting the ‘root’ password in MySQL •
•
Three methods are listed here o http://www.apachefriends.org/en/faq-xampp-windows.html#password0 o Please note, in the first (possibly easiest) method listed, the way to access the file in the xampp\mysql\bin directory is by using the Microsoft DOS emulator Go to start > run Once you have entered the commands here, you need to edit the config.inc.php, as shown in the link above. Now that these have changed, you need to make sure that the settings for your website are correct. • You need to access the configuration.php file in the root folder for your website and edit the line o var $password = 'yourpassword'; There is also a slightly less helpful forum topic here: o http://forum.joomla.org/viewtopic.php?f=429&t=406729&start=0
MySQL commands • • •
• •
Sometimes on forums you may come across instructions to run MySQL queries. Often, however, you can use the phpMyAdmin interface instead (for example, see the end of the Taxonomy section below) If you wish to run a query, open up phpMyAdmin, and click on the icon to the top-left of the screen
You can then paste your query into the window and run it. Obviously it is preferable to understand MySQL before you start running queries. The following website has a good tutorial: www.tizag.com
Installing Drupal • •
• • • •
• •
To install Drupal you first need to create a database for it (see Creating a database) Then create a new folder, ‘mysite’, in whichever location applies: o C:\XAMPP\htdocs\mysite o C:\Program Files\XAMPP\htdocs\mysite o This is the name of your site. To change the name of the site you simply need to change the name of this folder. The name of the database has nothing to do with the name of this folder or the URL, and does not need to be the same. Download and unzip Drupal and copy-paste the files into the newly created file on your server To install Drupal put the following in your browser o http://localhost/mysite Choose your language You will then get a page containing the message
o Follow the instructions in the error message o Remember that you are to copy the original file and rename only one of them, leaving one with its original name On the next page you need to enter your database details o Enter the name of the database you created o The default username will be ‘root’ o There is no default password
o o
There are also some advanced options available
• •
On the next page you simply need to set the site configuration, including the drupal admin name and password (NOT the same as the database user name and password), and then you are done Here is the Drupal documentation on installing if you encounter any problems not covered here o http://drupal.org/getting-started/install
Drupal administration
• •
Administrating the website is done whilst navigating the site itself. Only the administrator has access to the ‘administer’ pages on the menu The administrator has access to every option and page on the site, and these access rights cannot be removed
Modules: core and contributed Enabling / disabling modules • •
• •
Even core (optional) modules can be enabled or disabled, to make sure your site doesn’t get cluttered and slow. Many of them come disabled. To administer modules go to o Administer > site building > modules > List
You will then see a list of all modules. To enable or disable them, select or unselect the tick-box next to them, and then scroll down and click ‘save configuration’
Installing / uninstalling / reinstalling contributed modules •
To install new modules simply download them from the Drupal website, and upload the file into the following directory
o o • • • •
C:\xampp\htdocs\drupal\sites\all\modules Then you need to enable them
Next to the list tab where you enable/disable modules is the uninstall module Even if you delete the files associated with a module, there may still be tables associated with it in your database. Before you delete the files, disable the module and uninstall it. An uninstall option is not always available. To reinstall a module disable it, uninstall it, then enable it again.
Nodes/content •
Drupal operates on a very flexible classification of all content as ‘nodes’. These come in different node/content types. The the
This allows you to create new nodes/content This allows you to see the content you have already created
This allows you to edit and create content types
•
• •
When you go to Administer > Content management > content types you will see a page that displays all your content types
o Nodes have certain ‘fields’. When you create a new item of content you will have to fill in the name (title), the body text, and various other fields. Clicking on ‘manage fields’ will give you a view of the fields. The order fields are presented in the content creation form and in their final form can be altered using symbol highlighted below
o
•
To delete content you have created, go to o Content > update options Select ‘delete’ then click ‘update’ o You can also do this quickly using the Views Bulk Operations module
Paths / URLs / aliases •
• • •
As you can see from the drupal.org website, when accessing a node Drupal usually just gives a node ID, for example: www.websitename/node/13
This is a screenshot of the node table in phpMyAdmin, which shows the variable nid (node ID) Pathauto o It is possible to automatically create ‘aliases’, which change the url to the title of the node, using the Pathauto module (requires the Token module to run) After enabling this module there will be a field in the content creation form which allows you to create your own path, or simply to keep the default setting of an automatic creation of ‘aliases’, or URLs, corresponding to the title of a content type or user, instead of simply .../node/## Can be administered in o Administer > site building > URL aliases o This will also allow you to delete any aliases already created for your nodes (returning them to their default format of /node/##)
CCK (Content Construction Kit) •
•
CCK is basically an essential module that enables you to download modules that will enable you to add custom fields (such as the filefield and link modules covered below, and later also the)
• •
You will then be able to use the box highlighted above to either add new fields, or add custom fields that you have already created Once the field is created you also have the option to configure it and change the way it is displayed
o Filefield • • • • •
•
To add files as a field download the ‘filefield’ module You can then either add this field to an existing content type or create a new one If and when you have finished creating the new content type, go to the content types page o Administer > content management > content types Select ‘manage fields’ Then on the next page you can add a new field
o o The label appears to the user o The field name is read by the computer o The field type depends upon the CCK modules already uploaded (e.g. file, link, date) o There is generally only one option provided for widgets Having multiple sub-folders for your file upload directory is addressed here: http://drupal.org/node/283491
Link • • •
•
• •
To add links as a field download the ‘link’ module, and follow the same procedure as before This module requires that the links are of the form http:// For the purposes of document management there are at least two ways of achieving this o 1. You can use ftp o 2. You can put the files in a folder in the htdocs directory. The apache server will then treat them like files in a website, and allow you to open them (note: if you have problems with this try another browser ) Once you have created a link field you must configure it o We found it useful to provide a link to the shared drive root folder to browse for files o The user sees help text that looks like this Click here to access the shared drive via File Transfer Protocol o To achieve this, the following needs to be put in the configuration form Click
here to access the shared drive via File Transfer Protocol o This is a special HTML link because it includes the target section, which means that the link is opened in a new tab It may also be helpful to simplify the node creation form by changing the way the field is displayed by using the display fields tab (see above in CCK (Content Construction Kit)) Here are some links on this topic that may be useful: o http://www.webhostingtalk.com/showthread.php?p=6345077#post6345077 o http://drupal.org/node/549370
o
These two are forum questions I posted http://drupal.org/node/167169 This is about browsing file directories within Drupal
Input formats •
• •
•
• •
When creating a node, if you have sufficient access rights, you will be able to choose the input format. On the node creation form you will see something like this
o If, as is recommended, the rights of users are restricted, then they will have to use the default input format. For security reasons it is better that there should be a HTML filter, although on an intranet this is less of an issue. An HTML filter blocks all HTML tags except for the ones that are specifically allowed. Input formats are a combination of filters, and can be highly customised. o A filter simply takes an input and changes it so the output is different. It can remove things, add things and change things. The Flexifilter and Table of Contents section will explore them in more detail. To administer input formats o Administer > site configuration > input formats
o Here you will see a list of all the available input formats, of which you can set a new default, and you will also be able to create new ones. When you click ‘configure’ you will have three options, of which ‘configure’ (confusingly) is only one. o The first option is the ‘edit’ option. Here you will see a list of all the filters that you have available. You can select or deselect them to customise the input format.
o
o o
o
The ‘rearrange’ option allows you to set the order in which the filters are applied. This is relevant to the table of contents section later. The configure option allows you to configure any filters that are configurable (on Mine these are the Table of Contents, URL and HTML filters, not including the flexifilters—covered later). The HTML filter configuration is very useful because it allows you to give permission for other tags. The default filter doesn’t allow headings, so it is necessary to add permissions for headers if you want to include them. The tags are
etc. It is only necessary to specify the first part of an HTML tag. To generate a header in the Drupal text input box you would need to write Example text
Empty pages / Default front page •
•
The default front page is ‘node’. This page simply shows all nodes created, latest first. To change whether or not a node type gets promoted to the front page go to o Content management > content types > list > edit To change the url of the front page (e.g. to show a user guide node instead) go to o administer > site configuration > site
Blocks
Blocks are additions that you can make to a page, which are not in themselves nodes. To administer them go to o Administer > site building > blocks To enable blocks simply drag them into the relevant field (see below). For some reason it doesn’t seem to be necessary to activate the primary and secondary links blocks for them to show
o
Menus
The way that Drupal menus work means that you have to create content before adding it as a menu item. You then need to provide a path to link the menu item to. Alternatively you can add content to a menu as you are creating the content (there is a ‘menu settings’ field in content creation forms) To administer menus go to o Administer > site building > menus There are three default, pre-existing menus: navigation; primary links; secondary links. By default, only the navigation menu has any menu items. It is possible to add new menus. After you have created them you must enable their ‘blocks’ (see above) This is the navigation menu (vertical along the left)
These are primary links (horizontal along the top) These are secondary links (horizontal underneath)
To add an item to a menu you need to select the menu you want to edit and then select ‘add item’. You will need to know the URL of the desired location of the link. To change the position of an item on the menu you need to select the change its position in a hierarchy
icon and drag the item either up or down, or from side to side to
•
It is also possible to add nodes as menu items as you create them, rather than afterwards, using the ‘menu settings’ field in the content creation form. (You will in the Views section that these pages can also be added to menus)
Nice Menus • •
The default Drupal menu doesn’t look that great. Initially I replaced it using a module called ‘nice menus’, which converts the menu into one with pop-out links To get this menu to work you need to Install/enable it, and then also enabling the block for this module by dragging it into the left sidebar area for blocks. You will then also want to drag the navigation block into the disabled area for blocks. To do this go to o Administer > site building > blocks
SimpleMenu • • • • •
The current menu is the ‘simplemenu’, which creates a horizontal bar along the very top of a page Install/enable the module. As far as I remember it just appeared at the top of the screen. Go to blocks and disable any menu blocks that are no longer needed IMPORTANT: Set permissions to allow authenticated users to see the menu. Go to o Administer > user management > permissions Set configurations (including colours) in o Administer > site configuration > simplemenu
Administration Menu • • •
Creates a horizontal bar along the top of your screen with most functions that you would want on the admin section of a menu Install/enable the module. As far as I remember it just appeared at the top of the screen. Set configurations in o Administer > site configuration > administration menu
Taxonomy
Taxonomy is the way that Drupal creates categories and hierarchies for its nodes. There is a taxonomy field for every node node type that has a taxonomy(ies) assigned to it. It works by creating ‘vocabularies’, overarching categories, which contain terms. These terms can be structured into hierarchies by having some terms be the ‘children’ of other terms, which are their ‘parents’. This hierarchy can go infinitely deep. To administer taxonomy go to o Administer > content management > taxonomy
o o
It is then possible to add vocabularies, and add terms to or change the name of existing vocabularies
o o
To edit the terms in a vocabulary, including changing the hierarchy of the vocabulary (changing parent/children terms) click list terms When you click edit vocabulary you have the same options that you do when you create a vocabulary You can define the content types that a vocabulary can be applied to You can change the settings
• •
When you select the ‘tags’ option, when you are creating a node and applying terms in a vocabulary you get the autocomplete box given for ‘author’ below. This allows users to create their own tags. The ‘marketing’ box is what you get when you don’t select the tags option. The advantage of this is that the user can see all available tags, and the fact that they can’t create tags keeps the vocabulary tidy.
• It is possible to generate menus on the basis of taxonomies using the ‘taxonomy menu’ module To apply taxonomy terms en masse see the Views Bulk Operations module The management of taxonomies may also be greatly facilitated by the ‘taxonomy manager’ module. See Modules for easier administration It is possible to move terms from one vocabulary to another so that they still apply to the same nodes that were initially tagged with them. o Log into phpMyAdmin and find the table ‘term_data’ This is the table for taxonomy terms o You will see the first 30 taxonomy terms listed. To see more you will have to go on the next page. o There are various columns ‘tid’ stands for ‘term ID’ • Each term, vocabulary and node in Drupal has an ID number that identifies it ‘vid’ stands for ‘vocabulary ID’ o All you need to do to change the vocabulary that a term is assigned to is to change its vocabulary ID o To find out what the ID for a given vocabulary is find the ‘vocabulary’ table in the database o This issue is also considered here: http://drupal.org/node/382944
Creating users and setting access levels •
The various options for creating users and setting access levels are available at o Administer > user management
•
• • •
o There are three standard access levels o Anonymous These users have not logged in o Authenticated These are users that have logged in o Administrator Has all administration rights To administer the rights of anonymous and authenticated users go to o Administer > user management > permissions To create new roles (in addition to anonymous and authenticated), for example if you wanted two kinds of authenticated users, go to o Administer > user management > roles To create new users or change the details of existing users go to o Administer > user management > users
Modules for easier administration • •
•
•
Advanced help module o Once installed, help (usually a readme) can be viewed under Administration > advanced help Site Documentation module o Installed. Provides an overview of the site. To see a site report go to Administer > site building > site documentation o To configure how the site report is shown go to Administer > site configuration > site documentation > report Taxonomy manager o See http://drupal.org/project/taxonomy_manager o Views Bulk Operations provides similar but not identical functions Administration Menu
Views: display and search • • •
• • •
The views module allows you to create pages or blocks that display pretty much anything you want in pretty much any way you want. It is located at o Administer > site building > views The first page you will see looks like this
Each box represents a different view. The grey views are disabled, the blue views are enabled. There are a range of disabled default views that come as standard. To create a new view click the ‘add’ tab o The next page requires you to fill in details and settings of the view. You will probably be looking for a node view. o When this page is filled you will see the following page 10
1
5
9
7
8
4
3
2
6
1. The default display a. This is an important one to understand. The default display does not have a path, and does not actually produce a display. If you want to create a new page or block in which to display a view you must click add display (a display is a page or a block that shows your view, but one view can have many displays, and these can all have fully individualised settings) b. Every time you try to add or edit anything in this new display you will see something like this
c. d. When you are using default values, anything you add or edit will also be added or edited in the default display. Any other display that also uses default values will also be added and edited. When you override the default display, your changes will be specific to that display e. Therefore, if you have multiple displays, it is more efficient to use the default display to edit them all but only insofar as you want them to be the same. For example, when using a Views Bulk Operations display you may want it to be the same as another display. f. Every time you return to your view to edit it you will land on the default display. If you want to edit a display not using default values, you will need to navigate to it. 2. The page settings section allows you to create a menu item for your view, and to specify a path (URL) at which your view will be located. 3. The fields section is where you add the items that you actually want to be displayed in your view. To add fields click a. You will then see a block like this
b. c. To add elements of a node, such as the node title, body, or author, select the ‘node’ group d. To add custom node fields (such as files and links), select the ‘content’ group (these are CCK fields, for more information see CCK (Content Construction Kit): File uploads and links below) e. To add taxonomy terms select the ‘taxonomy’ group 4. Filters allow you to create a kind of search function a. This is how they appear on the view page
b. c. To filter according to taxonomy terms you will need to create a new filter for each individual taxonomy vocabulary. i. After adding a new ‘taxonomy: term’ view you will be asked to configure its settings
ii. iii. The boxes above are ‘dropdown’ boxes iv. The hierarchy option gives dashes in front of child terms in the taxonomy (see below)
v. vi. You then need to expose the filter to allow users to see it vii. The operator is all of will be the most intuitive operator to use viii. When you have exposed the filter, change the label to the name of the vocabulary ix. Deselect ‘force single’ 5. The basic settings section allows you to control how the view appears
a. b. The ‘style’ setting allows you to set various different styles c. To find out what these are i. Click on the link next to ‘style’
ii. iii. Then click on the ? icon. This will take you to a help page. d. In addition to the sort function (see 7), clicking on the you to define fields as sortable by users.
icon for the ‘style’ row will enable
e. f. On your view page you will then be able to click on the field titles and the lists will be sorted according to the selected field title g. 6. The live preview section is supposed to show you how your view will appear 7. Sort criteria allow you to define criteria by which your data will be ordered, for example name of the author in ascending/descending alphabetical order, or the creation date. However the settings field (5, above) also contains a sort function 8. Arguments a. Arguments are a difficult one to understand, but they seem to be a filter that filters the URL of a node. They are necessary for creating Calendars with the calendar and date module b. Learn more about arguments here: http://gotdrupal.com/videos/drupal-views-arguments
9. Relationships a. There are only a limited number of relationships that exist, all listed below
b. 10. Using the clone button you can create another view identical to the one you already have (bulk operation displays and all). This will be useful for calendars. If your tagging system gets too large and you want to create different search pages for different clients and teams, you could simply clone the view you already have and create a new menu item. 11. There is a Views tutorial here: http://drupal.org/node/114642
Views Bulk Operations •
•
• •
VBO allows you to create a display that includes a ‘bulk operations’ field that allows you to apply them to all nodes selected in the view
o The following bulk operations are available
o To create a bulk operations display, install/enable VBO, then create a new page for your display, using the same view as you use to search for documents, with the same default settings Go to settings and change the style to ‘bulk operations’. Set the settings to select which bulk operations you want to implement, create a path and menu item for this display
Other search options • •
•
Here is a useful article comparing options for searching in Drupal o http://poplarware.com/drupalsearch.html For our purposes the best two options are o The views filters o Faceted search may also have some useful features, and should be the first place to look for additional functionalities to those provided by views The search bar on the top-right-hand corner of the screen is a block, a module, and has display settings on the theme. The theme setting relies on the block and the block on the module. o Administer > site building >modules > list o Administer > site building > blocks o Administer > site building > themes
Images • •
•
•
There are many options for uploading images to nodes. Using the image and image assist modules o This is my preferred method, because it supports inline image insertion into nodes (inserting images alongside text). o The image module allows users to upload images onto their site by creating a new content type. These can be found at Administer > content management > content o The image assist module allows users to insert images into nodes To insert an image into the body of a node you click on the link at the bottom-right. A window is then opened. It allows you to browse images that already exist or to upload a new image. Users with advanced options will be able to define the insert mode: either a filter tag or full HTML. This should be filtered filter tag because it contains a relative reference and allows the site name to be changed. • note: this is not the same as the input format on the photo upload form; this is the second stage: filtered or full HTML. However I will explain both options here. • To enable inline images to be embedded using full HTML then the defalt input format for the node must be full HTML for authenticated users. To change the default input format go to: o Administer > site configuration > input formats Make full HTML the default and then click ‘configure’ and enable inline image insertion • To insert using filter tags go to o Administer > site configuration > input formats Keep filtered HTML as the default setting. Click ‘configure’ and enable inline image insertion To administer image assist go to • Administer > site configuration > image assist Here it is possible to do the following • Change the nodes that image assist will apply to (under access settings) • Change the default input format (under image property dialog settings) Using imagefield and imagecache o Imagefield adds a custom field to your nodes using CCK. Imagecache then allows you to customise the size of these images and the way they are presented. The problem with this method is that you cannot insert images alongside text, only in a field of their own. The advantage is that images are all presented in a tidy, standardised way. Imagefield depends on filefield and some other modules. Using the IMCE module is another possibility I haven’t explored.
•
Here is a useful summary of images on drupal: http://drupal.org/node/163346
Wiki Books
A book is a collection of nodes. These can be any type of nodes: links, files, pages, etc. It is a useful alternative to taxonomy for creating groupings of nodes. First it is necessary to enable the book module, which is part of the core You will then have the option of adding any content type to a book. Books cannot just be created in themselves, it is necessary to use the following method: o When you are creating or editing a node, expand the book outline field. You will then have the option of either adding the node to an existing book or creating a new one. If you create a new one, it will be named after the top page, the node in question. If you add it to existing ones, you will be able to create a hierarchy of content by adding children to parent pages (the default parent page is the top page)
o You will also have a new content type that you will be able to create, ‘book page’. In fact, this is exactly the same as a normal page except it has a different name. Book navigation block o You can make books easier to navigate by using the book navigation block, which shows a menu with the book hierarchy when you are browsing books. Go to Administer > site building > blocks > list o Then enable the book navigation block
FCKeditor (WYSIWYG) •
• •
•
The FCKeditor is a module that gives you a WYSIWYG (what you see is what you get) editor that gives you formatting options at the top of your screen. Instead of putting in HTML the editor does this for you, and shows you the way it will look when the node is created.
Installation o The installation of the FCKeditor contains a potential pitfall. You have to download two separate packages. First Install/enable the FCKeditor module, available from the Drupal website Then install the FCKeditor itself from: http://www.fckeditor.net/download • You need to open the FCKeditor file and copy-paste the files and folders inside this into this folder in the Drupal module directory o C:\xampp\htdocs\mysite\sites\all\modules\fckeditor\fckeditor • This will have a file in it called COPY_HERE Here is a forum post on this topic: http://drupal.org/node/494450 o The FCKedior should then appear above text fields. To configure FCKeditor go to Configuration
Administer > site configuration > FCKeditor To change the options that you have in your WYSIWYG editor (e.g. the ability to change fonts) go to the above address and select ‘edit’ for the advanced profile, and under ‘editor appearance’ change the ‘toolbar’ settings. The screenshot above is for the ‘drupalbasic’ toolbar FCKeditor and filters o Just because an option works when you are writing or editing text this does not mean that the node will actually appear like that. What you see is not necessarily what you get! This is because your filters might be filtering out the functions on FCKeditor. You need to configure the HTML filter to allow things such as headings, for example. This is covered in Input formats Problems with the FCKeditor o I have had problems with the FCKeditor whereby big strings of meaningless text appear in my nodes. I think this may be because of copy+pasting text into the WYSIWYG editor. I resolved this by deleting the spaces before and after the string of text. o o
•
•
Table of Contents • •
• • •
• •
• • • •
Filters were covered in the Input formats section, which this will build on. Now we have our WYSIWYG editor and we have given permissions for headers we can add headings and sub headings to the body section of our nodes. The Table of Contents module enables us to automatically generate a table of contents from these headers which will appear before the body section of our node, like this
o First install/enable the Table of Contents module A table of contents filter has just been created. To enable this for your default input format go to o Administrator > site configuration > input formats > list > configure default format (filtered HTML, probably) > edit Then, because of a bug in the module, you need to change the order of the filters, so that the ToC module comes first. Go to o Administrator > site configuration > input formats > list > configure default format (filtered HTML, probably) > rearrange o And move the ToC filter up to the top Now we have done this we can add a table of contents to the body of our nodes by inserting this at the beginning o [toc list: ol; title: Table of Contents; minlevel: 2; maxlevel: 3; attachments: yes;] However, it is a nuisance to have to insert this, so we can configure the table of contents filter to do this automatically o Administrator > site configuration > input formats > list > configure default format (filtered HTML, probably) > configure > Table of Contents And select ‘If no [Toc...], automatically add one at the top of the page’ You can also set the number of headers before an automatic ToC is added Deselect ‘include link to hide/show filters’ because this creates redundant text when the link has been filtered Now when you go to edit the body text, you will see a red dotted split across the middle. The area below this is the one you need to edit.
Flexifilter • •
The flexifilter module enable you to create custom filters. It comes with a Mediawiki format as an example format. This filters simple instructions and converts them to HTML o For example if a user wanted to create a second-level header they would write ==Header Text==
• • • •
And the filter converts this to Header Text
o Note: the flexifilter Mediawiki format doesn’t include first-level headers, just second, third and fourth level headers After you install/enable the flexifilter format you can apply the mediawiki filter by enabling it in o Administrator > site configuration > input formats > list > configure default format (filtered HTML, probably) > edit Don’t forget that the HTML filter must have the necessary tags enabled for flexifilter to work, as with FCKeditor Flexifilter can be used to create custom filters. For example if I wanted a signature to be added at the bottom of all of my nodes I could create a custom ‘signature’ filter that simply added text. If I wanted to filter out swearwords I could use a filter to replace ‘swearword’ with ‘s*******d’ For tutorials on flexifilter see o http://drupaldojo.com/taxonomy/term/189 o http://drupal.org/node/217177
Wikitools •
Wikitools includes all sorts of options that you might find on normal wikis. To explore these go to o Administer > site configuration > wikitools
o
Diff (difference in revisions) •
The diff module creates a record of revisions to certain nodes and enables you to compare different versions. When you have revised a node (created a revision) a new ‘revisions’ tab appears on the node
•
o Warning: revising is not the same as simply editing a document. The difference is that under the ‘revision information’ field, ‘create new revision’ must be selected. This can, however, be set as default.
•
o To set ‘create new revision’ as default go to o Administer > content management > content type > edit content type > workflow settings
o
•
Then select ‘create new revision’ under default option
o You should be able to enable/disable the module under o Administer > content management > content type > display fields
Talk • • • •
The Talk module automatically moves all comments from the bottom of wiki pages to a ‘talk’ page Install/enable the module, then go to o Content management > content types > list > edit project wiki Then select/deselect ‘display comments on separate talk page’ under the comment settings field Leave a comment, then look for the ‘talk’ tab along the top o
Calendars • •
Creating calendars on Drupal can be done in two ways o A combination of the CCK, Views, Date and Calendar modules o The ‘events’ module. However this is still in its development stage for Drupal 6 For more information here is a long tutorial: http://www.packtpub.com/article/adding-calendar-towebsite-using-drupal6
Date • • •
The date module enables you to create a new node field using CCK. You can then create ‘event’ node types. We want to create three event types: meetings, vacations and birthdays. You will need to create three new event content types, and three new fields, one for each event. For the type of data to store, select ‘date’ for all of them; don’t worry too much about datestamp or datetime
•
o For the form element to add to the data select
•
o This allows you to have a recurring event and creates a pop-up date selector
• •
o For each of the new event content types you will need to configure each of their fields. After adding a new field and saving, you will be taken to the following page o Administer > content management > content types > ‘event’ > manage fields > configure Configurations o Birthday Default value: now • This will make filling dates easier in the node creation form To date: never Granularity: year + month + day Default display: see below Repeat display: collapsed • This is the repeat options display in the node creation form – it looks tidier when it is collapsed o Meeting Default value: now Default value for To date: same as From date To date: required Granularity: year + month + day + hour + minute Default display: see below Repeat display: collapsed o Vacation Default value: now Default value for To date: same as From date To date: required Granularity: year + month + day Default display: see below Repeat display: collapsed o Default displays These are the ways in which your dates will eventually be displayed on the calendar We want to create a custom formats for meetings, otherwise the dates will be displayed in full (it will include information for year, month and day, which is already displayed by the calendar; only hours and minutes are needed) And it doesn’t matter what the displays for birthdays or vacations are, because we will only need to display a name; we will not display information for hours and minutes First create a new format • Administer > site configuration > date and time > formats > add format
Create a new custom format using the PHP manual (see screenshot for link) Then go to • Administer > site configuration > date and time > formats > configure And change the short date format to your new format
• Then save configuration You now have a new date format to set as a default display in your three date field configurations (though it only really matters for meetings). It doesn’t matter that much what you set as default, because you will be able to change the presentation of the date field later in views. (If other parts of the site also use short date format then maybe you should consider making custom formats—but I haven’t noticed any problems myself)
Calendar •
• • • •
• •
The calendar module enables you to create a view that displays date fields. Here is one possible display format (one thing that might require explanation is the column on the left—this is the week in the year)
Install/enable the calendar module (no need to enable iCal) Enable the default calendar view in o Administer > site building > views > list Then for each display that you want, clone the default display.
The default calendar view includes the ‘calendar page’ display. For some reason, when I create a new page this doesn’t display dates on a calendar properly. Therefore, every time you want to create a new
calendar (i.e. one for birthdays, meetings and vacations), you need to create a new view, not just a new display. You may as well create one view and clone that. Disable the default calendar view after you have disabled it.
• •
•
• • •
Fields o For fields you need to have node title, and the from and to dates for the node field that you created. o Remove existing ‘node: updated date’ field, but keep the ‘node: title’ field o Add a new field Group: content Content: from and to dates for meetings and vacations, just a single date for birthdays. For vacations and meetings you will then be creating two fields, with two forms, and will have only one for birthdays: • Deselect ‘group multiple values’ (if, later, you want to group multiple values then use overridden rather than default, because this selection isn’t compatible with some of the other displays • For birthdays and holidays select ‘exclude from display’. This means that only the name will show up on the calendar. Because you aren’t displaying holidays and birthdays you will not have to worry about how they are presented. • Therefore the following only applies to meetings: o Set labels to ‘none’ o In the ‘from date’ form select ‘display from and to date’ o In the ‘to date’ form select ‘exclude from display’ o If you are sure the default format is set correctly (see above), set the the format to default o Hide repeat rule (haven’t explored this feature, but shouldn’t be necessary) Arguments o Change the ‘date field’ in the default argument from ‘node: updated date’ to the content field ‘from date’. Add another argument that is exactly the same (display default values etc.) except select the content field ‘to date’, otherwise the node title appears twice. You want it to look like this:
o Remove the default sort criterion Add path and menu settings Change the title to meeting room, vacations or birthdays
Number of files corresponding to tag •
One functionality that it was mentioned might be useful was the ability to see how many files correspond to a tag, for example in brackets next to the tag. I think this can be achieved using the faceted search module bundle, using the taxonomy facet module, which then gives you a list of vocabularies and sub-lists of the terms in each vocabulary, with the number of files corresponding to each tag given in brackets (all these are administered under blocks).
Printer, email and PDF versions •
•
This module enables you to add links to printer, email and PDF versions of your nodes. However, for the PDF generator to work you need to install an additional PDF generation tool. For more information see the INSTALL.txt in the ‘print’ module folder. You can change whether these get added to nodes by default by going to o Administer > content management > content types > list > edit
Themes: installing and editing Default and contributed themes • • • •
In Drupal templates are called ‘themes’. The installation comes with a range of default themes. To configure these go to o Administer > site building > themes These are customisable to varying degrees, e.g. colour, logo, favicon, by changing the configuration of the theme To install a new contributed theme first download a theme from Drupal o download > themes o http://drupal.org/project/themes?solrsort=sis_project_release_usage%20desc Then just copy the folder into the folder o Mysite > themes
Editing CSS • •
• •
•
CSS stands for ‘cascading stylesheets’ o One such style sheets can be applied to many HTML sheets. This enables the template to be kept separate from the rest of the website HTML. To edit the CSS files o Or you can edit the files in the joomla! folder on your computer. (Joomla folder)\templates\beez\css This is the best way, especially since you can easily copy-paste a backup folder that you can restore whenever you do something wrong. Without knowing much about CSS and HTML it is still possible to completely change the colour scheme of your template To find out the location of the file and the relevant section of code within it, use the Firefox Web Developer tool o One of the options with this tool is that when you click on any part of a website it will show you the location of the relevant CSS file(s), and also the location of the relevant section of code within it To edit the file use the following program o ConTEXT This allows you to search for particular lines, saving you scrolling. It allows you to open .css, .html and .php files in their proper format
•
Within the relevant section of code, ‘colour’ refers to the colour of the text and ‘background colour’ refers to the colour behind the text. In CSS and HTML colours are given in ‘hex’ code. Some useful hex code is given below. To find out the hex code of any colour you can o Go to websites such as www.colourpicker.com o Use the Huey colour picker tool. This has a colour picker that you can use to select any colour you see on your screen.
Changing your logo • •
Create your logo (to create a new logo I used the freeware GIMP), in Drupal this is in the .PNG format You can replace the old one in two ways o by going to Administer > site building > themes > configure theme And then by giving the location of your new logo. o Or by changing the logo in the folder directory, as follows Then use this to replace the original logo in the location • mysite > themes > (folder for theme you are using, e.g. bluemarine) In Drupal the logo does not need to be the same size as the one it is replacing
Changing your favicon • • •
Your favicon is the icon that shows next to the site address in your browser, and next to your site name at the top of a tab. I created the logo using the freeware Gimp and the .ico file converter www.converticon.com There are two ways of changing your favicon: o By going to Administer > site building > themes > configure theme And then by giving the location of your new favicon. o Or by changing the logo in the folder directory, as follows Then use this to replace the original favicon in the location • mysite > misc
Internet resources • • • •
This is a step-by-step tutorial to create a document management system on Drupal: http://cafuego.net/2009/05/31/simple-drupal-document-management-system Good tutorials on web design; HTML; CSS; PHP and MySQL: http://www.tizag.com/ A good intro to HTML and CSS: www.how-to-build-websites.com Drupal o Drupal glossary: http://drupal.org/node/122018 o Drupal terminology (more complete): http://drupal.org/node/937