Community @ The Turning Gate

Support community for TTG plugins and products.

You are not logged in.

#1 2018-09-17 07:25:03

tmszewczuk
Member
From: Fairfield Glade, TN USA
Registered: 2015-06-14
Posts: 53
Website

Breadcrumbs in BL2 non-gallery pages

REF http://community.theturninggate.net/vie … hp?id=8430

Daniel Leu, this broke in our BL2 upgrade.  I read your 'sticky' in BL2 Support  but don't know enough about PHP to get it to work in BL2 without hammering my sites.  Can you help?

Tom Szewczuk

I've restored the old custom PHP back


Thomas Szewczuk
Website  TestSite Admin-email
'The nation which forgets its defenders will be itself forgotten - Calvin Coolidge, 1923 - 1929'

Offline

#2 2018-09-17 08:00:52

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 3,779

Re: Breadcrumbs in BL2 non-gallery pages

Untested, but this is what the new version would look like:

function ttg_crumb( $page_name ) {
	echo '<ul class="breadcrumbs"><li class="fa_pseudo" itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/" itemprop="url"><span itemprop="title">Home</span></a></li><li class="fa_pseudo" itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title">'. $page_name .'</span></li></ul>';
}

function main_top(){
	// Add breadcrumbs to non-gallery pages
	if ($this->slug == 'about') {
		$this->ttg_crumb('About');
	} else if ($this->slug == 'contact) {
		$this->ttg_crumb('Contact');
	} else if ($this->slug == 'search) {
		$this->ttg_crumb('Search');
	} else if ($this->slug == 'xxxx) {
		$this->ttg_crumb('Xxxx');
	}
}

Offline

#3 2018-09-18 01:21:17

tmszewczuk
Member
From: Fairfield Glade, TN USA
Registered: 2015-06-14
Posts: 53
Website

Re: Breadcrumbs in BL2 non-gallery pages

Ben, the snippet you posted fails with error " Something went wrong Unexpected error: syntax error, unexpected 'Contact' (T_STRING) in Myphplugins.php on line 528 Please report error at http://community.theturninggate.net"


Thomas Szewczuk
Website  TestSite Admin-email
'The nation which forgets its defenders will be itself forgotten - Calvin Coolidge, 1923 - 1929'

Offline

#4 2018-09-18 02:38:36

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 1,097
Website

Re: Breadcrumbs in BL2 non-gallery pages

This updated version works for me:

function ttg_crumb( $page_name ) {
	echo '<ul class="breadcrumbs"><li class="fa_pseudo" itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/" itemprop="url"><span itemprop="title">Home</span></a></li><li class="fa_pseudo" itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title">'. $page_name .'</span></li></ul>';
}

function main_top(){
	// Add breadcrumbs to non-gallery pages
	if (strtolower($this->slug) == 'about') {
		$this->ttg_crumb('About');
	} else if (strtolower($this->slug) == 'contact') {
		$this->ttg_crumb('Contact');
	} else if (strtolower($this->slug) == 'search') {
		$this->ttg_crumb('Search');
	} else if (strtolower($this->slug) == 'xxxx') {
		$this->ttg_crumb('Xxxx');
	}
}

Daniel Leu | Photography   
DanielLeu.com

Offline

#5 2018-09-18 03:10:43

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 15,252
Website

Re: Breadcrumbs in BL2 non-gallery pages

tmszewczuk wrote:

Ben, the snippet you posted fails with error " Something went wrong Unexpected error: syntax error, unexpected 'Contact' (T_STRING) in Myphplugins.php on line 528 Please report error at http://community.theturninggate.net"

Make sure you're starting with the updated phplugins file (backlight.php) from the backlight/custom/phplugins/ folder.
There's some new coding in there that is required for the functions to work.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Pangolin test site, Backlight 1.1.1 test site

Offline

#6 2018-09-18 05:27:03

tmszewczuk
Member
From: Fairfield Glade, TN USA
Registered: 2015-06-14
Posts: 53
Website

Re: Breadcrumbs in BL2 non-gallery pages

I'm alittle fuzzy on which custom php file to copy/modify so I tried  phplugins-pangolin-sample.php and old backlight.php files.  I inserted the following code to the bottom of each which still does not produce breadcrumbs on non-gallery pages. What am I missing??

 function ttg_crumb( $page_name ) {
	echo '<ul class="breadcrumbs"><li class="fa_pseudo" itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/" itemprop="url"><span itemprop="title">Home</span></a></li><li class="fa_pseudo" itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title">'. $page_name .'</span></li></ul>';
}

function main_top(){
	// Add breadcrumbs to non-gallery pages
	if (strtolower($this->slug) == 'about') {
		$this->ttg_crumb('About');
	} else if (strtolower($this->slug) == 'mycontact') {
		$this->ttg_crumb('Contact');
	} else if (strtolower($this->slug) == 'rssfeeds') {
		$this->ttg_crumb('RSS');
	} else if (strtolower($this->slug) == 'sitenews') {
		$this->ttg_crumb('Site News');
	} else if (strtolower($this->slug) == 'websearch') {
		$this->ttg_crumb('Web Search');
	} else if (strtolower($this->slug) == 'search') {
		$this->ttg_crumb('Search');
	} 

Thomas Szewczuk
Website  TestSite Admin-email
'The nation which forgets its defenders will be itself forgotten - Calvin Coolidge, 1923 - 1929'

Offline

#7 2018-09-18 05:45:41

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 15,252
Website

Re: Breadcrumbs in BL2 non-gallery pages

see Daniel’s post on updating to Backlight 2 phplugins files. http://community.theturninggate.net/vie … hp?id=8966

Note the very first code he quotes. The phplugins file must have that.

It's actually been updated to this:

if (defined('BACKLIGHT_HOOK')) {
	require_once(realpath(BACKLIGHT_HOOK).'/modules/module-designer/application/helpers/APHPlugins.php');
}

class PHPlugins extends APHPlugins
{

(unless that first part is still only part of the testing stream, in which case, it will be part of the release version very soon)

Anyway, make sure the file you're starting with has all that, otherwise it won't work.

Anyway, the


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Pangolin test site, Backlight 1.1.1 test site

Offline

#8 2018-09-18 07:00:35

tmszewczuk
Member
From: Fairfield Glade, TN USA
Registered: 2015-06-14
Posts: 53
Website

Re: Breadcrumbs in BL2 non-gallery pages

Ok folks I almost give up.  Would it be too much to actually give me the contents of the whole file the way it's supposed to look like.  The only file I have in my custom  is okapi sample and that didn't work for work either.  I feel I'm missing something very basic.


Thomas Szewczuk
Website  TestSite Admin-email
'The nation which forgets its defenders will be itself forgotten - Calvin Coolidge, 1923 - 1929'

Offline

#9 2018-09-18 07:12:09

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 15,252
Website

Re: Breadcrumbs in BL2 non-gallery pages

weird. I have no okapi-sample.php file in backlight/custom/phplugins/
I'll email you the default backlight.php file with Daniel's code at the top of the user area. I'll comment out the other sample functions.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Pangolin test site, Backlight 1.1.1 test site

Offline

#10 2018-09-18 08:56:29

tmszewczuk
Member
From: Fairfield Glade, TN USA
Registered: 2015-06-14
Posts: 53
Website

Re: Breadcrumbs in BL2 non-gallery pages

rod wrote:

weird. I have no okapi-sample.php file in backlight/custom/phplugins/
I'll email you the default backlight.php file with Daniel's code at the top of the user area. I'll comment out the other sample functions.

phplugins-okapi-sample.php is what I have in custom/phplugins

Thanks Rod, I received the email

Problem:  I installed your file into /backlight/custom/phplugins/.  When I go to my DarkStarterPage --->Advanced Setup --->PHPlugins --->Include File pull down I don't see the PHP script listed.  I went back and moved all except backlight-with-crumbs.php to a save folder and did the select again which displayed all the plugins from before, excluding backlight-with-crumbs.php.

I cleared cache, chmod 755 and update all albums but that didn't fix anything.  Any ideas? I have your file installed on my test site.

Last edited by tmszewczuk (2018-09-18 09:06:18)


Thomas Szewczuk
Website  TestSite Admin-email
'The nation which forgets its defenders will be itself forgotten - Calvin Coolidge, 1923 - 1929'

Offline

#11 2018-09-18 09:23:29

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 15,252
Website

Re: Breadcrumbs in BL2 non-gallery pages

Are you using the current Pangolin-based Dark Starter template? (I don't recall if there was an Okapi version)

the only other thing I can think of is that you're installing the file on one test site and looking for it on another. Is there a chance of that happening?


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Pangolin test site, Backlight 1.1.1 test site

Offline

#12 2018-09-18 09:46:09

tmszewczuk
Member
From: Fairfield Glade, TN USA
Registered: 2015-06-14
Posts: 53
Website

Re: Breadcrumbs in BL2 non-gallery pages

rod wrote:

Are you using the current Pangolin-based Dark Starter temlate? (I don't recall if there was an Okapi version)
the only other thing I can think of is that you're installing the file on one test site and looking for it on another. Is there a chance of that happening?

Location was fixed by repointing the test domain
Script had small error at the end and this was fixed.  Breadcrumbs now work! 

Thanks much for all the time and the breadcrumbs script!!

*/
} // END

// ****************************************************************************************************
// END USER FUNCTIONS
} ?>

Last edited by tmszewczuk (2018-09-19 05:03:47)


Thomas Szewczuk
Website  TestSite Admin-email
'The nation which forgets its defenders will be itself forgotten - Calvin Coolidge, 1923 - 1929'

Offline

Board footer

Powered by FluxBB