I've added a new page to hubs\[mytheme]\calendar-main.aspx and I need to add a link to the sidebar (where the Home, Blogs, Discussions, etc. links are for the group) to get to this new page.
I've added a new url in SiteUrls.config under the hubs location that looks like this:
<url name="hub_calendar" path="##hubdirectory##calendar/default.aspx" pattern="##hubName##/calendar/default.aspx" vanity="{2}?App=${{app}}" physicalPath="##hubThemeDir## page="calendar-main.aspx" applicationType="calendar" />
I added a SiteUrl control to the Themes/Hubs/[mytheme]/theme.Master page that looks like this:
<CSControl:SiteUrl UrlName="hub_calendar" ResourceName="calendar" runat="server" Tag="LI" />
A link shows up where I want it and it tries to link to the correct page, but it is missing the "hubName" part. So the link is basically this: http://[root]/cs/groups//calendar/default.aspx. How can I get it to pick up the hubName correctly so the link will show up?
Thanks
-Glen
Try this. You won't need your SetLink code anymore, I believe.
<CSControl:SiteUrl runat="server" UrlName="hub_calendar" ResourceName="Calendar" Tag="LI"> <Parameter1Template> <CSHub:HubData runat="server" Property="ApplicationKey" /> </Parameter1Template></CSControl:SiteUrl>
John Bledsoe
Sr. Software Specialist - ATGi
I've found a hacky way to do it, but I'd still rather do it the "correct" way if someone can help me out.
To get it working I put an asp:Hyperlink in place of the SiteUrl control. I then added a method "SetLink" that looks like this:
protected void SetLink(){string baseUrl = CommunityServer.Components.CSContext.Current.SiteUrl;StringBuilder url = new StringBuilder("http://");url.Append(baseUrl);if (!baseUrl.EndsWith("cs")) url.Append("/cs");url.AppendFormat("/groups/{0}/calendar/default.aspx", HubControlUtility.Instance().GetCurrentHub(this).Name);myHyperlink.NavigateUrl = url.ToString();}
It works, but it's a hacky way to have to do it.
John Bledsoe: Try this. You won't need your SetLink code anymore, I believe. <CSControl:SiteUrl runat="server" UrlName="hub_calendar" ResourceName="Calendar" Tag="LI"> <Parameter1Template> <CSHub:HubData runat="server" Property="ApplicationKey" /> </Parameter1Template></CSControl:SiteUrl>
Perfect! That's exactly what I needed.
Thanks for the help Mr. Bledsoe.
Copyright© 2008 Telligent Systems Inc. All rights reserved CommunityServer.com • Telligent.com