Page 1 of 1

[SOLVED] Breadcrumbs Tag and Show in Menu

Posted: Tue Mar 23, 2010 10:35 pm
by visualharmony
I'm having an issue with the Breadcrumbs tag where it isn't showing the full path to the current page for pages that are children of a page that has "Show in Menu" unchecked in the page's Options tab.

So, instead of:

Home >> Parent page with Show in Menu Unchecked >> Child of page with Show in Menu Unchecked

I get:

Home >> Child of page with Show in Menu Unchecked

Is there something I am missing or is this how breadcrumbs should work.  How could I work around this to get the breadcrumbs to display the links for the full path?

TIA,
Jack

Re: Breadcrumbs Tag and Show in Menu

Posted: Tue Mar 23, 2010 10:36 pm
by visualharmony
Forgot to say that the CMSMS version is 1.6.6 "Bonde."

Re: Breadcrumbs Tag and Show in Menu

Posted: Wed Mar 24, 2010 1:24 pm
by Peciura
For this trick you will need module CGSimpleSmarty. Paste this template instead of "Breadcumbs" tag

Code: Select all

{assign var='page_position' value='.'|explode:$position}
{assign  var='temp_alias' value=$page_alias}

{foreach from=$page_position name='breadcumbs'  item=not_used}
	{capture assign='temp_var'}breadcumb_{math equation="x-y" x=$smarty.foreach.breadcumbs.total y=$smarty.foreach.breadcumbs.index}{/capture}
	{assign var=$temp_var value=$temp_alias}
	{$cgsimple->get_parent_alias($temp_alias,'temp_parent')}
	{assign var='temp_alias' value=$temp_parent}
{/foreach}

{foreach from=$page_position name='breadcumbs'  item=not_used}
	{capture assign='temp'}{literal}{${/literal}breadcumb_{$smarty.foreach.breadcumbs.iteration}{literal} }{/literal}{/capture}
	{capture assign='temp_page_alias'}{eval var=$temp}{/capture}
	{if !$smarty.foreach.breadcumbs.last}
	{cms_selflink page=$temp_page_alias|trim}
		 >> 
	{else}
		{$cgsimple->get_page_title()}
	{/if}
{/foreach}

Re: Breadcrumbs Tag and Show in Menu

Posted: Wed Mar 24, 2010 6:04 pm
by visualharmony
Thank you, Peciura!  Worked perfectly!  ;D