You are here

README.txt in Page Title 5

********************************************************************
                P A G E    T I T L E    M O D U L E
********************************************************************
Original Author: Robert Douglass
Current Maintainers: Nicholas Thompson and John Wilkins

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

   This module gives you control over the page title. It gives you the chance
   to provide patterns 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 see the "Page title" field on node edit forms.

********************************************************************
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` )
    ) /*!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') {

    // These are the only important lines
    if (module_exists('page_title')) {
      $vars['head_title'] = page_title_page_get_title();
    }

  }
  return $vars;
}

  As you can see from the code comment, there are only three important lines
  of code:

  if (module_exists('page_title')) {
    $vars['head_title'] = page_title_page_get_title();
  }

  These lines need 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.

File

README.txt
View source
  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. DESCRIPTION:
  8. This module gives you control over the page title. It gives you the chance
  9. to provide patterns for how the title should be structured, and on node
  10. pages, gives you the chance to specify the page title rather than defaulting
  11. to the node title.
  12. ********************************************************************
  13. PERMISSIONS:
  14. This module defines the "set page title" permission. This permission
  15. determines whether a user will see the "Page title" field on node edit forms.
  16. ********************************************************************
  17. INSTALLATION:
  18. 1. Place the entire page_title directory into your Drupal modules/
  19. directory.
  20. 2. Enable this module by navigating to:
  21. administer > modules
  22. At this point the Drupal install system will attempt to create the database
  23. table page_title. You should see a message confirming success or
  24. proclaiming failure. If the database table creation did not succeed,
  25. you will need to manually add the following table definition to your
  26. database:
  27. CREATE TABLE `page_title` (
  28. `nid` INT NOT NULL ,
  29. `page_title` VARCHAR( 128 ) NOT NULL ,
  30. PRIMARY KEY ( `nid` )
  31. ) /*!40100 DEFAULT CHARACTER SET utf8 */;
  32. 3. Optionally configure the two variations of page title by visiting:
  33. administer > settings > page_title
  34. 4. The page title is ultimately set at the theme level. To let your PHPTemplate
  35. based theme interact with this module, you need to add some code to the template.php
  36. file that comes with your theme. If there is no template.php file, you can simply
  37. use the one included with this download. Here is the code:
  38. function _phptemplate_variables($hook, $vars) {
  39. $vars = array();
  40. if ($hook == 'page') {
  41. // These are the only important lines
  42. if (module_exists('page_title')) {
  43. $vars['head_title'] = page_title_page_get_title();
  44. }
  45. }
  46. return $vars;
  47. }
  48. As you can see from the code comment, there are only three important lines
  49. of code:
  50. if (module_exists('page_title')) {
  51. $vars['head_title'] = page_title_page_get_title();
  52. }
  53. These lines need to be added to the 'page' hook of the _phptemplate_variables
  54. function.
  55. Alternately, you can call page_title_page_get_title() from page.tpl.php
  56. directly at the place where the title tag is generated.