1

I would like to remove the link to homepage in my page logo and menu item called "Home" if you are actually navigating in the Homepage, that is, the logo and Home link in the menu should not be a link if you are in the Homepage, in any other page they should be links again.

Any ideas on how to achieve this?


Many Thanks

anleon
  • 632
  • 3
  • 8
  • 22
tif
  • 1,109
  • 2
  • 12
  • 32

1 Answers1

1

Check using: PageReference.StartPage.ID == Container.CurrentPage.PageLink.ID

You could use it as the Visible-condition for placeholders around the A-tags... And instead of the property-control that will auto-link the name just use: <%# HttpUtility.HtmlEncode(Container.CurrentPage.PageName)%>

Johan Kronberg
  • 1,086
  • 7
  • 12
  • Thanks for the Johan, that would do the job. – tif Apr 21 '11 at 06:34
  • Great! Remove "Container." and just use CurrentPage.PageLink.ID outside of the menu control (for the logo in your case). – Johan Kronberg Apr 26 '11 at 10:55
  • I found a bug on my solution. My site has both EPiServer and Non-EpiServer Pages. The problem is that CurrentPage.PageLink.ID gets values from the startPage of my site (EPiServer page) when in a non-EPiServer page. This means that the logo is not a link on all the non-EPiServer pages. Can I check before if the Page is an EPiServer page? Thanks for the help – tif Apr 28 '11 at 14:39
  • Found a solution for this in the following [link](http://stackoverflow.com/questions/5820493/how-to-differentiate-if-the-current-page-is-an-episerver-page-or-not) – tif Apr 29 '11 at 09:16