/[drupal]/contributions/modules/page_title/README.txt
ViewVC logotype

Contents of /contributions/modules/page_title/README.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.6 - (show annotations) (download)
Sat Dec 29 17:23:49 2007 UTC (23 months ago) by njt1982
Branch: MAIN
CVS Tags: DRUPAL-6--2-3, DRUPAL-6--2-2, DRUPAL-6--2-1, DRUPAL-6--2-0, HEAD
Branch point for: DRUPAL-6--1, DRUPAL-6--2, DRUPAL-7--1, DRUPAL-7--2
Changes since 1.5: +4 -4 lines
File MIME type: text/plain
Syncing HEAD with DRUPAL-5--2
1 ********************************************************************
2 P A G E T I T L E M O D U L E
3 ********************************************************************
4 Original Author: Robert Douglass
5 Current Maintainers: Nicholas Thompson and John Wilkins
6
7 ********************************************************************
8 DESCRIPTION:
9
10 This module gives you control over the page title. It gives you the chance
11 to provide patterns for how the title should be structured, and on node
12 pages, gives you the chance to specify the page title rather than defaulting
13 to the node title.
14
15 ********************************************************************
16 PERMISSIONS:
17
18 This module defines the "set page title" and "administer page titles"
19 permissions. The "set page title" permission determines whether a user will
20 be able to edit the "Page title" field on node edit forms (if visible.) The
21 "administer page titles" permission determines whether a user will be able to
22 edit the "Page title" administration pages.
23
24 ********************************************************************
25 INSTALLATION:
26
27 1. Place the entire page_title directory into your Drupal modules/
28 directory or the sites modules directory (eg site/default/modules)
29
30
31 2. Enable this module by navigating to:
32
33 Administer > Build > Modules
34
35 At this point the Drupal install system will attempt to create the database
36 table page_title. You should see a message confirming success or
37 proclaiming failure. If the database table creation did not succeed,
38 you will need to manually add the following table definition to your
39 database:
40
41 CREATE TABLE `page_title` (
42 `nid` INT NOT NULL ,
43 `page_title` VARCHAR( 128 ) NOT NULL ,
44 PRIMARY KEY ( `nid` )
45 ) /*!40100 DEFAULT CHARACTER SET utf8 */;
46
47 3. Optionally configure the two variations of page title by visiting:
48
49 Administer > Content management > Page titles
50
51 4. The page title is ultimately set at the theme level. To let your PHPTemplate
52 based theme interact with this module, you need to add some code to the template.php
53 file that comes with your theme. If there is no template.php file, you can simply
54 use the one included with this download. Here is the code:
55
56 function _phptemplate_variables($hook, $vars) {
57 $vars = array();
58 if ($hook == 'page') {
59
60 // These are the only important lines
61 if (module_exists('page_title')) {
62 $vars['head_title'] = page_title_page_get_title();
63 }
64
65 }
66 return $vars;
67 }
68
69 As you can see from the code comment, there are only three important lines
70 of code:
71
72 if (module_exists('page_title')) {
73 $vars['head_title'] = page_title_page_get_title();
74 }
75
76 These lines need to be added to the 'page' hook of the _phptemplate_variables
77 function.
78
79 Alternately, you can call page_title_page_get_title() from page.tpl.php
80 directly at the place where the title tag is generated.

  ViewVC Help
Powered by ViewVC 1.1.2