My new blog present here.

Featured Post

Insights into Sitecore Search: A Definitive Introduction

A key component of digital experience management is effective information retrieval. A simplified approach is required for websites, applications, and platforms containing a lot of material so that consumers can easily get the data they require. This need is met by Sitecore, a well-known name in the field of digital experience platforms (DXPs), which provides powerful and comprehensive search functionality. We will travel into the realm of Sitecore Search in this article, learning about its capabilities, architecture , and the enormous value it offers both developers and end users. Introduction to Sitecore Search    A headless content discovery platform powered by AI , Sitecore Search enables you to build predictive and custom search experiences across various content sources. To extract and ...

How access relative url of site in Sharepoint-Used in master pages



If you are creating the master pages in SharePoint. In this master page
you have created the image tab and you want to linked this image tab
with the particular page(for example publish page in Sharepoint) from
the SharePoint site(or site collection). Another use of relative url is
if you are referencing resources such as style sheets, images,
JavaScript etc in a SharePoint environment you need to be careful to
ensure that URLs are relative to the current site (or site collection)
so that if sites are moved the references don’t break.

For example you have created the image tag :







Now you want to linked this image tab with AboutUs page(for example publish page in Sharepoint) of your current SharePoint site(or site collection in SharePoint):

i. For Site URL(relative site url in sharepoint):






In the above anchor tag(i.e. tag a) we have written the runat="server", its mean we are
telling to the sharepoint engine that its is a server side control not client site.

ii. For Site Collection URL(relative site collection url in sharepoint):








In the above anchor tag(i.e. tag a) we have written the runat="server", its mean we are
telling to the sharepoint engine that its is a server side control not client site.

We can use relative url in master pages, page layouts or other pages on the site by
using the SPUrl expression. SPUrl define prefix provided by the
Microsoft.SharePoint.Publishing.WebControls.SPUrlExpressionBuilder class.



Comments

Popular posts from this blog

Sitecore GraphQL Queries

Sitecore Experience Manager Cloud (XM Cloud) Building blocks

Configuring Sitecore Next.js Headless SXA Multisite App in a Sitecore Container