Relative URLs on Sharepoint Home Page

I have a tabbed homepage. Tabs are defined by the following sitemap:

<siteMap>
    <siteMapNode title="Home" url="~/" >
        <siteMapNode title="Schedule" url="~/Pages/Tab2.aspx"/>      
        <siteMapNode title="Deliverables" url="~/Pages/Tab3.aspx"/>
        <siteMapNode title="My Items" url="~/Pages/Tab4.aspx"/>
        <siteMapNode title="Management" url="~/Pages/Tab5.aspx"/>
        <siteMapNode title="Working Docs" url="~/Pages/Tab6.aspx"/>
    </siteMapNode>
</siteMap>

The problem is that on my affiliate sites, clicking on the tab brings me back to the root. For example, I want the schedule link to go to http: //Server/Subsite/Pages/Tab2.aspx . Instead, I get http: //Server/Pages/Tab2.aspx . I read that having a tilde at the beginning of the link will solve this problem, but it is not.

+3
source share
3 answers

You are looking for a site token, here is a list of URL token attributes for WSS.

+1
source

, , , , , . ProjectProperty WSS MOSS, ProjectProperty URL- .

<SharePoint:ProjectProperty Property="Url" runat="server"/>

URL-. , , ( , src= ' href=' ' HTML):

<a href='<SharePoint:ProjectProperty Property="Url" runat="server"/>/pages/Tab2.aspx'>

, ! ProjectProperty, ( !)

+11

, ... , URL- ... , , - URL- ... MOSS ...

I found the following to work:

Script Tags:

<script type="text/javascript" src='<asp:Literal runat="server" 
               Text="<% $SPUrl:~Site/appBin/js/jquery.min.js %>" />'></script>

Style sheet (method suggested by user 385947 above):

<link rel="stylesheet" type="text/css" 
       href="<% $SPUrl:~Site/appBin/css/jquery-ui.css %>" />

Hope this helps others ...

+7
source

Source: https://habr.com/ru/post/1721243/


All Articles