• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: [solved] {cms_breadcrumbs} giving some headace
PostPosted: Tue Jul 31, 2012 8:27 am 
Offline
Forum Members
Forum Members

Joined: Tue Jan 22, 2008 6:53 pm
Posts: 66
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:

Code:
{if $page_alias="home"}
      You are here: <strong>Startsida</strong>
{else}
      {menu action='breadcrumbs'}
{/if}


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....

Code:
{if $page_alias!="home"}
      {menu action='breadcrumbs'}
{else}
      You are here: <strong>Startsida</strong>
{/if}


....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


Last edited by zigge on Tue Jul 31, 2012 9:23 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: {cms_breadcrumbs} giving some headace
PostPosted: Tue Jul 31, 2012 8:43 am 
Offline
Power Poster
Power Poster
User avatar

Joined: Wed Sep 05, 2007 8:03 pm
Posts: 3649
Location: The Netherlands
{if $page_alias="home"} should be {if $page_alias=="home"} perhaps?

_________________
Get nice guestbook messages from your site visitors with the brand new Gbook module.
Integrate Piwik Web Analytics in your site admin with the Piwik module.
Extend your global site settings with the Custom Global Settings module.
The Fourth Dutch CMS Made Simple Workshop on April 9 2011 was great fun! Read all about it here
Announcement: The Fifth Dutch CMS Made Simple Workshop coming up?


Top
 Profile  
 
 Post subject: Re: {cms_breadcrumbs} giving some headace
PostPosted: Tue Jul 31, 2012 9:23 am 
Offline
Forum Members
Forum Members

Joined: Tue Jan 22, 2008 6:53 pm
Posts: 66
Jos wrote:
{if $page_alias="home"} should be {if $page_alias=="home"} perhaps?


Well, I now feel stupid... Yep, adding the == works. Simple stuff that so easily beeing overlooked.


Top
 Profile  
 
 Post subject: Re: [solved] {cms_breadcrumbs} giving some headace
PostPosted: Tue Jul 31, 2012 9:59 pm 
Offline
Administrator
Administrator
User avatar

Joined: Thu Mar 09, 2006 5:32 am
Posts: 11812
Location: Arizona
Maybe reading it again might help?... ;)

http://www.smarty.net/docsv2/en/languag ... ion.if.tpl

_________________
Extensions » Modules/Tags click the name of the module/tag or Help to the right to get its parameters.
Right click and view source is a great way to see what you have to work with.
Check ver. CMSMS, PHP, server OS, in System Information page.
Default content http://multiintech.com/defaultcontent/
People are Wonderful
Business is Great
Life is Terrific
Ever wonder what happened to the Album module? Well it is alive and well.
http://album.multiintech.com/
Image


Top
 Profile  
 
 Post subject: Re: [solved] {cms_breadcrumbs} giving some headace
PostPosted: Wed Aug 01, 2012 6:42 am 
Offline
Forum Members
Forum Members

Joined: Tue Jan 22, 2008 6:53 pm
Posts: 66
Dr.CSS wrote:
Maybe reading it again might help?... ;)

http://www.smarty.net/docsv2/en/languag ... ion.if.tpl


yeah, yeah.....rub it in.... :)


Top
 Profile  
 
 Post subject: Re: [solved] {cms_breadcrumbs} giving some headace
PostPosted: Wed Aug 01, 2012 9:52 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu Feb 08, 2007 6:11 pm
Posts: 481
Location: Florida
Code:
{if $page_alias eq 'page-alias'}


"eq" is less confusing for me as is "not" and regular words which then when I go back I can follow what my idea was.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner