Skip to content

Instantly share code, notes, and snippets.

@martsie
Created January 25, 2017 11:02
Show Gist options
  • Save martsie/c9884ffbcdbebdfb5d47091e531d2b49 to your computer and use it in GitHub Desktop.
Save martsie/c9884ffbcdbebdfb5d47091e531d2b49 to your computer and use it in GitHub Desktop.
An example of a consistent Drupal 7 page title update command
<?php
// Change the page title.
$site_title = variable_get('site_name');
$page_title = t('My Great Page');
$ajax_commands[] = ajax_command_invoke(NULL, 'changePageTitle', array($page_title . ' - ' . $site_title));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment