Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save maietta/d089d35805584bcf65ceed8abca803d4 to your computer and use it in GitHub Desktop.
Save maietta/d089d35805584bcf65ceed8abca803d4 to your computer and use it in GitHub Desktop.
Bigfoot Bite: Altering page titles sitewide.
// Place this in your /index.php, modified to your satisfaction.
// Hook into the end of dom to extend the F3 template engine to inject `{{ @page_title }}` for landing or `{{ @page_title }} | RETSQL` everywhere
// else and set to "Untitled Document" when not present.
Bigfoot::instance()->on("end_of_dom", function($dom){
$format = ( Base::instance()->get("PATH") != "/" ) ? '{{@page_title}} | RETSQL' : '{{@page_title}}';
$dom->getElementsByTagName('title')->item(0)->nodeValue = $format;
return $dom;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment