Created
May 8, 2021 22:38
-
-
Save maietta/d089d35805584bcf65ceed8abca803d4 to your computer and use it in GitHub Desktop.
Bigfoot Bite: Altering page titles sitewide.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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