Community @ The Turning Gate

Support community for TTG plugins and products.

You are not logged in.

#1 2018-02-03 16:24:44

Daniel Leu
Registered: 2012-10-11
Posts: 931

Breadcrumbs on standard pages

Backlight provides the option to use breadcrumbs on all gallery pages to simplify navigation. I like to have a common look and feel of my site and prever to have breadcrumbs on all pages. Thanks to phplugins, this is something that can easily be done.

First I use some helper functions 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;

function ttg_crumb( $page_name ) {
	echo '<ul class="breadcrumbs"><li class="fa_pseudo" itemscope itemtype=""><a href="/" itemprop="url"><span itemprop="title">Home</span></a></li><li class="fa_pseudo" itemscope itemtype=""><span itemprop="title">'. $page_name .'</span></li></ul>';

Breadcrumbs are located at the top of the 'main' section. So I use ttg_main_top to insert them:

function ttg_main_top( $style, $path ){
	// Add breadcrumbs to non-gallery pages
	if ( page_match('/about') ) {
	} elseif ( page_match('/contact') ) {
	} elseif ( page_match('/backlight/search') ) {
	} elseif ( page_match('/xxxx') ) {

If you have other pages on your site, just add them in another 'elseif' branch. All this code belongs into your custom phplugins file.

You find a bit more about phplugins in the documentation at … _phplugins.

Daniel Leu | Photography


Board footer

Powered by FluxBB