README.txt 2.73 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
********************************************************************
                     D R U P A L    M O D U L E                         
********************************************************************
Name: Page title module
Version: 0.1
Author: Robert Douglass
Email: rob ad robshouse dot net
Last update: February 21, 2006
Drupal: 4.7

********************************************************************
DESCRIPTION:

 * This module gives you control over the page title. It gives you the chance
 * to provide templates for how the title should be structured, and on node
 * pages, gives you the chance to specify the page title rather than defaulting
 * to the node title.

********************************************************************
PERMISSIONS:

This module defines the "set page title" permission. This permission determines
whether a user will se the "Page title" field on node edit forms.

********************************************************************
SYSTEM REQUIREMENTS:

Drupal: 4.7

********************************************************************
INSTALLATION:

1. Place the entire page_title directory into your Drupal modules/
   directory.
 

2. Enable this module by navigating to:

     administer > modules
     
   At this point the Drupal install system will attempt to create the database
   table page_title. You should see a message confirming success or
   proclaiming failure. If the database table creation did not succeed,
   you will need to manually add the following table definition to your
   database:
   
    CREATE TABLE `page_title` (
      `nid` INT NOT NULL ,
      `page_title` VARCHAR( 128 ) NOT NULL ,
      PRIMARY KEY ( `nid` )
    ) TYPE = MYISAM /*!40100 DEFAULT CHARACTER SET utf8 */;    
     
3. Optionally configure the two variations of page title by visiting:
   
    administer > settings > page_title
    
4. The page title is ultimately set at the theme level. To let your PHPTemplate
   based theme interact with this module, you need to add some code to the template.php
   file that comes with your theme. If there is no template.php file, you can simply
   use the one included with this download. Here is the code:

function _phptemplate_variables($hook, $vars) {
  $vars = array();
  if ($hook == 'page') {
  
    // This is the only important line
    $vars['head_title'] = page_title_page_get_title();
    
  }
  return $vars;
}

  As you can see from the code comment, there is only one important line
  of code:
  
  $vars['head_title'] = page_title_page_get_title();
  
  This line needs to be added to the 'page' hook of the _phptemplate_variables
  function.
  
  Alternately, you can call page_title_page_get_title() from page.tpl.php
  directly at the place where the title tag is generated.