html - Page title not updating? Drupal/PHP hook title -
i'm trying change page title. visit page - click here.
this written custom module within drupal 7. file called wb_spc.module module code in jsfiddle, please click here.
i've tried changing lines 51 , 59 won't change h1 page title?
please see code snippet below:
/** * implements hook_menu(). */ function wb_spc_menu() { $items = array(); // admin configuration group. $items['admin/config/wb_spc'] = array( 'title' => 'workbooks self-assessment crm roi calculator', 'description' => 'administer wb crm requirements', 'access arguments' => array('administer wb crm requirements'), ); // admin configuration - settings. $items['admin/config/wb_spc/manage'] = array( 'title' => 'workbooks self-assessment crm roi calculator settings', 'description' => 'manage wb crm requirements settings , configurations.', 'access arguments' => array('administer wb spc requirements'), 'page callback' => 'drupal_get_form', 'page arguments' => array('wb_spc_admin_settings_form'), ); $items[variable_get('wb_spc_path')] = array( 'title' => 'workbooks self-assessment crm roi calculator', 'page callback' => 'drupal_get_form', 'page arguments' => array('wb_spc_form'), 'access arguments' => array('access content'), 'type' => menu_callback, ); $items['wb_spc/test'] = array( 'title' => 'testing - workbooks self-assessment crm roi calculator', 'page callback' => 'wb_spc_test', 'access arguments' => array('access content'), 'type' => menu_callback, ); $items['wb_spc/results/%'] = array( 'title' => 'wb show pdf', 'page callback' => 'wb_spc_show_pdf', 'page arguments' => array(2), 'access arguments' => array('access content'), ); return $items; }
in page (the 1 see user), add this:
drupal_set_title('page title goes here');
change <h1>
, believe page title changed if do. if want page title other <h1>
use method drupal_set_title('page title goes here');
to change page use:
if($_server['http_host'].$_server['request_uri'] == 'www.yourdomain.com/rest/of/url'){ drupal_set_title('page title goes here'); }
Comments
Post a Comment