Support community for TTG plugins and products.
NOTICE
The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.
This forum is now closed, and exists here as a read-only archive.
You are not logged in.
Pages: 1
With CE4, G_STYLE could be used to insert page specific PHP code using phplugins. With Backlight, this is no longer possible. But there is a simple way around that:
First I need a simple helper function to keep my code clear and legible:
function page_match($gallery) {
if (substr($_SERVER["REQUEST_URI"], 0, strlen($gallery)) == $gallery) {
return 1;
} else {
return 0;
}
}
And then I use this function to match specific pages:
function ttg_main_top( $style, $path ){
if ( page_match('/about') ) {
echo '....';
} elseif ( page_match('/contact') ) {
echo '....';
} elseif ( page_match('/galleries/') ) {
echo '....';
} elseif ( page_match('/backlight/search') ) {
echo '....';
}
}
As you can see, this can be used to select a single page or several pages on a lower level (eg, galleries) and then introduce page specific code. On my site, I use this add breadcrumbs to my standard pages.
All this code belongs into your custom phplugins file.
You find a bit more about phplugins in the documentation at http://backlight.theturninggate.net/doc … _phplugins.
Daniel Leu | Photography
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com
Offline
For Backlight 2, please see http://lab.danielleu.com/blog/page-specific-php-code/
Daniel Leu | Photography
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com
Offline
Pages: 1