2010-11-23 130 views
0

我在一個sitecore環境中託管兩個網站。 我修改的web.config讓sitecore,太長的網址,多個網站

<site hostName="subdomain1.domain.com" startItem="/home" ... /> 
<site hostName="subdomain2.domain.com" startItem="/SecondSite/Homepage" ... /> 

的問題是使用SC上的菜單鏈接我產生XSLT渲染:(。)路徑太長。

http://subdomain2.domain.nl/sitecore/content/SecondSite/CaptivatingPage.aspx 

我想要的鏈接看起來像

http://subdomain2.domain.nl/CaptivatingPage.aspx 

請給我一個提示。

回答

2

該網站的真正根源是SiteRoot + StartItem,因此在你的情況下它是/sitecore/content/SecondSIte/Homepage。您在XSL渲染中生成鏈接的頁面不在網站的根目錄下 - 與主頁位於同一級別。

sc:path(.)應該給你一個友情鏈接,並在主頁下的每個頁面將是http://subdomain2.domain.nl/EachPage.aspx,但對根目錄外的項目,將與完整路徑串連它:​​3210

所以,試運行CaptivatingPage在主頁下,你會得到你所期望的。

0

不確定您正在使用的CMS版本,但在web.config中查看是否存在linkManager元素。如果是這樣,請嘗試定義shortenUrls = true屬性。

另一種選擇是創建一個覆蓋路徑方法的xslt擴展函數,指定您自己的UrlOptions邏輯。