Вопрос

I'm creating a content editor web part that needs to point to the site collection root. Currently, for it's "Content Link" URL field, I have ../../SiteAssets/js/jquery-rotator/slider.txt but this is inconvenient because if I'm in a publishing page such as /Pages/MyFolder/page.aspx, the path will have to be changed.

Is there a way to provide a path that always points to the site collection root's SiteAssets folder? Thanks.

Это было полезно?

Решение

None of the answers in the comments are correct. Correct answer : ~sitecollection/SiteAssets/js/jquery-rotator/slider.txt

Several comments :

  • You cannot point to something outside of your site collection.
  • There are other tokens, such as ~site . I'll let you people google them.
  • sharePoint does not like "..". It might remove them. Although in more recent versions it worked (provided you stay within the site col) and it's even necessary because in some fancy documents sets home pages, SharePoint considers the current subfolder's URL to be the current location. To see exactly what SharePoint considers the current location, click on "try link" and see what URL it builds in your brower's address bar.
Лицензировано под: CC-BY-SA с атрибуция
Не связан с sharepoint.stackexchange
scroll top