p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional SharePoint 2010 Branding and User Interface Design (http://p2p.wrox.com/forumdisplay.php?f=610)
-   -   NavigateUrl (http://p2p.wrox.com/showthread.php?t=83537)

moswalt May 4th, 2011 05:33 PM

NavigateUrl
 
My question is on the NavigateUrl and why do I have to go one level higher than I thought needed. Here is my setup.

I have a site collection http://server/blogs using the blog site template
blogs is an explicit inclusion managed path
started with Mr. Drisgill's foundation starter page
style.css in Site Assets
logo.png in Site Assets

This code works:
<SharePoint:CssRegistration name="/blogs/Site Assets/style.css" After="corev4.css" runat="server"/>

<div class="customLogo">
<SharePoint:SPLinkButton runat="server" NavigateUrl="~sitecollection/">
<SharePoint:SiteLogoImage LogoImageUrl="/blogs/SiteAssets/logo.png" runat="server"/>
</SharePoint:SPLinkButton>
</div>

This code doesn't, but I expected it to based on how you set your links in Chapter 8 page 232-233:
<SharePoint:CssRegistration name="/SiteAssets/style.css" After="corev4.css" runat="server"/>

<div class="customLogo">
<SharePoint:SPLinkButton runat="server" NavigateUrl="~sitecollection/">
<SharePoint:SiteLogoImage LogoImageUrl="/SiteAssets/logo.png" runat="server"/>
</SharePoint:SPLinkButton>
</div>

Is this due to it not being a publishing site??

Thanks in advance and love the book.

drisgill May 12th, 2011 12:35 AM

I think I understand your question, and I'm wondering if /blogs/ is a site collection or just a site. ~sitecollection will take you to the root of the site colleciton... while ~site would be the root of the current site.

That being said consider that the NavigateUrl is simple used to set the link that is followed when the site logo is clicked. The CssRegistration and SiteLogoImage aren't using the site collection relative link here, so "/" references the top level of the web application. So the CSS and image in the 2nd example are looking at the root of the web app for the sub folders where the 1st example is looking at the root/blogs.

Does that make sense?


All times are GMT -4. The time now is 02:24 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.