[solved] {cms_breadcrumbs} giving some headace
Posted: Tue Jul 31, 2012 8:27 am
Now, after upgrading to 1.11 and reinstalled the Menu Manager, I now can use the {cms_breadcrumbs} instead of the old {breadcrumbs}
However, the old tag presented the name of the start page even if it was not set as active in the menu, and this was preferable from my part. In the new {cms_breadcrumbs}, if the page was not set to active in the menu, no output woult come from this tag.
Easy fix I thought, just adding an If/else/endif in my page template, to validate the page alias, and either put a static text, or add the {cms_breadcrumbs}
Ohhhh man....after several hours dumping out variables and almost bashing the laptop to pieces I found something I can't explain.
First, this is my initial code:
Now this would give me the same breadcrumb text on whatever page that loads, namely the static text. Also, looking at the dumped variables, the $page_alias is always "home"!!!!
Changing to look at the $page_id now results in that the $page_id is always the same regardless of of page selected!!!
Tried $page, $page_name, $page_id and $page_alias. Same behavior!
Now to the spooky stuff....turning the condition around to....
....and it works! And the dumped template variables are changing as the should when shifting pages.
Now, can you clever guy's tell me what is going on?
Mats
However, the old tag presented the name of the start page even if it was not set as active in the menu, and this was preferable from my part. In the new {cms_breadcrumbs}, if the page was not set to active in the menu, no output woult come from this tag.
Easy fix I thought, just adding an If/else/endif in my page template, to validate the page alias, and either put a static text, or add the {cms_breadcrumbs}
Ohhhh man....after several hours dumping out variables and almost bashing the laptop to pieces I found something I can't explain.
First, this is my initial code:
Code: Select all
{if $page_alias="home"}
You are here: <strong>Startsida</strong>
{else}
{menu action='breadcrumbs'}
{/if}
Changing to look at the $page_id now results in that the $page_id is always the same regardless of of page selected!!!
Tried $page, $page_name, $page_id and $page_alias. Same behavior!
Now to the spooky stuff....turning the condition around to....
Code: Select all
{if $page_alias!="home"}
{menu action='breadcrumbs'}
{else}
You are here: <strong>Startsida</strong>
{/if}
Now, can you clever guy's tell me what is going on?
Mats