Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [link-manager]

For questions related to Sitecore's LinkManager, including behavior, customization and extension, custom providers, testing, etc.

Filter by
Sorted by
Tagged with
0 votes
1 answer
155 views

Issue with links for a SXA Multisite when a site definition has multiple hostnames

I've got this odd issue with our Sitecore 10.2 with SXA implementation. I have a site definition that has multiple host names associated with it. On occasion, the links on the site will include the ...
soze's user avatar
  • 93
1 vote
4 answers
656 views

How to Remove Dependable Links when deleting item using item.Delete()

We are programmatically removing items using item.Delete() in C#. Deleted items that were linked to other items are appearing as broken link When manually deleting in Sitecore we get options like ...
Sylesh JL's user avatar
  • 179
2 votes
3 answers
684 views

Calling ItemUrlBuilder method in Sitecore 10.1

We have upgraded to Sitecore 10.1 from Sitecore 8.7. In Sitecore 8.7 We used MultisiteItemLinkProvider which derives from LinkProvider and its obsolete in Sitecore 10.1. In Sitecore 8.7 we use the ...
Owais Ahmed's user avatar
0 votes
2 answers
170 views

How should I remove the default home item & website name from the URL?

Recently I have upgraded our site from v10.0.2 to v10.0.3 using XM topology. After upgrade I have rebuilt the indexes / link databases as well. But after upgrading sitecore is generating URL like ...
Harish's user avatar
  • 129
1 vote
1 answer
48 views

Why are links rendering the full Sitecore content path?

I'm upgrading from SXA 1.9 to 10.2 and have noticed that links on the front-end are rendering the full Sitecore content path such as /sitecore/content/tenant/site/home/path. What can I check to fix ...
Mark Gibbons's user avatar
  • 5,632
0 votes
1 answer
195 views

Javascript link rendered without onclick attribute in preview

When using javascript link the edit mode renders the target script in onClick attribute <a href="#" onclick="javascript:void(0);onclick=javascript:openOverlay('test-overlay',event);...
nari447's user avatar
  • 407
0 votes
2 answers
767 views

Using Sitecore link Manager in scriban script

I have a general link that is linking to an item in Sitecore. Path to linked item --> /sitecore/content/home/pageItemWithLayout I am using the below scriban script below to render the item link. &...
Shaurya's user avatar
  • 457
0 votes
1 answer
170 views

Add query string to all Media item in Sitecore SXA 9.3

Is there any way by which I can add a query string in each media item requested in SXA include CSS, js, images, fonts, etc. Current URL - http://us.dev.local/-/media/base-themes/core-libraries/...
Rohan Bhateja's user avatar
0 votes
0 answers
19 views

Sitecore And Web Service on Same Hostname not working [duplicate]

We have a Sitecore instance with a domain - abc.com and a Custom WebService is created which is also using the same domain as abc.com/internalservice.asmx, upon calling this service from Sitecore ...
Rohan Bhateja's user avatar
1 vote
1 answer
210 views

File path not accessible from Sitecore link manager

Sitecore Version: 9.3 with SXA We want to access the local file directory from the Link on the website. For that, we have entered, file directory path in Insert External Link. After that, On the ...
Raman Gupta's user avatar
  • 2,569
1 vote
0 answers
66 views

Set General Link Internal Path Globally

Has anyone set the start path of the General Link field globally when choosing internal? I can do it per item/template, but looks like it requires custom code to have it applied globally. I thought ...
RReilley's user avatar
  • 755
1 vote
0 answers
112 views

CustomLink provider is working on english but not on other languages

I've built a custom link provider which returns the complete url when the linked item is not from context website. It works as expected on english, but even if I add options.Language = Sitecore....
iusmar's user avatar
  • 239
0 votes
1 answer
768 views

Sitecore 9.3 CustomLinkProvider [duplicate]

There is a similar questions but sadly there's no help in there. I'm trying to create a CustomLinkProvider in Sitecore 9.3 and I have 2 problems: The LinkProvider() is Obsolete. What should I use ...
iusmar's user avatar
  • 239
2 votes
1 answer
709 views

Looking for External link Manager in Sitecore to declare URLs in one common place and reuse them

I am looking for the option to maintain external links in common location and refer through out the pages. For example if my site uses link www.xyz.com/redirect in 100 pages , I will declare it in one ...
Mohd Ilyas's user avatar
0 votes
1 answer
246 views

Extend internal link functionality [duplicate]

Let there be 3 sites within same Sitecore instance. When a General Link links pages from site A to Site B or Site C, Sitecore returns the relative path, not the complete url, if using the "...
iusmar's user avatar
  • 239
0 votes
0 answers
32 views

Deobfuscate Sitecore.Kernell.dll [duplicate]

If anyone has been able to deobfuscate Sitecore.Kernell.dll to debug an issue, can you kindly list the steps. I need to investigate a prod issue with LinkManager. On adding log lines upto the point ...
Tiger's user avatar
  • 33
3 votes
3 answers
2k views

LinkManager generating url for wrong site intermittently

We have Sitecore 9.3 multisite setup on Azure PAAS. We have been noticing a weird issue where for "internal" urls, LinkManager.GetItemUrl is intermittently generating urls for different site ...
Tiger's user avatar
  • 33
0 votes
1 answer
1k views

Custom Link Provider in Sitecore 9.3

I am upgrading from Sitecore 9.1 to Sitecore 9.3. I have a CustomLinkProvider class which derives from LinkProvider which is obsolete in Sitecore 9.3. What is the replacement for this in Sitecore 9.3?
Prateek's user avatar
  • 61
2 votes
1 answer
1k views

How to get URLS added in the Rich Text field and Link Manager Fields?

I want to redirect my urls added in the Rich Text Editor,General Links to custom urls on page load. To get the URLS which exist in the General Link field and in the Rich Text Editor, I am using the ...
Gautam Aneja's user avatar
1 vote
0 answers
154 views

Open graph URL does not contain language

I'm using Sitecore 9.1 and SXA 1.8, I want to embed the language in the og:url meta tag, I've checked the configuration of the LinkManager, languageEmbedding is set to true, but still it's not ...
Mohamed Yaseen's user avatar
1 vote
1 answer
261 views

Is there a way to automatically include link querystrings when dynamically rendering Sitecore links?

I have a number of places in my code where I render links from templates like so: <a href="@(Model.Link == null ? string.Empty : Model.Link.Url)">@Model.Link.Text</a> However I'...
Erica Stockwell-Alpert's user avatar
2 votes
1 answer
558 views

LinkManager.ResolveTargetSite is obsolete - what is the replacement

In Sitecore 9.3, if I try and call LinkManager.ResolveTargetSite, I see an obsolete message: Please use IItemBasedSiteResolver instead. But I can find absolutely nothing about how to use ...
Ethan Schofer's user avatar
1 vote
0 answers
145 views

Enforce 443 port added in the generated media url

In my local environment, I have 2 sitecore JSS sites running and I need to make both available over http. one with port 80 and one with port 443. Example: http://abc.com http://abc.com:443 I ...
Jojo's user avatar
  • 463
0 votes
1 answer
266 views

Preview links with SXA

Let have example structure: Normally when there is no SXA tenants exist and New Sample Item is published, LinkBuilder.GetItemUrl() will return something like https://sc93sc.dev.local/en/New-tenant/...
sc guest's user avatar
2 votes
1 answer
1k views

Render a link field that has a url with query params as a query param (version 7.2)

I'm trying to render a link like the following as an external link - however it's cutting off part of the query parameter. So when I try to render this: https://www.example.com?url=http://www....
Sean T's user avatar
  • 252
1 vote
2 answers
1k views

General Link - Insert Javascript contains return false causes error

When I tried to put a simple javascript inside the Insert Javascript of General Link it wasn't able to make it properly work as I noticed it appends a return false which causes an error. The rendered ...
Jovit Mayo's user avatar
0 votes
0 answers
232 views

Sitecore language prefix not setting language cookie [duplicate]

This didn't seem to be an issue until recently. I have a language toggle on my site for English/French that when clicked, adds the appropriate language prefix to the current URL (e.g. /products -> /fr-...
Erica Stockwell-Alpert's user avatar
0 votes
1 answer
174 views

Item accessible only via display name

As I know, by default, an item is accessible both via name and display name. This creates SEO issue because there is duplicate content. Is there a simple way to disable access via name or I need to ...
alecasciaro's user avatar
0 votes
2 answers
2k views

How to insert an internal path in Sitecore General Link field?

I have a template which contains a General Link field. If a new item is created of that template, then the link field should be populated with the item's current path. Suppose, template A have a ...
PSS's user avatar
  • 607
0 votes
0 answers
351 views

How to remove /sitecore/content/home from a URL using LinkManager? [duplicate]

I have a scenario in which LinkManager returns the URL with /sitecore/content/home/myitem. Here my domain is www.abc.com and I want to access this item as www.abc.com/myitem instead of www.abc.com/...
PSS's user avatar
  • 607
3 votes
1 answer
322 views

Media Provider ignoring site scheme setting

In a site setting you can set the scheme for the site. i.e. Scheme=https <site name="website"> <patch:attribute name="scheme" value="https"/> </site> The item Link Provider ...
Chris Auer's user avatar
  • 13.1k
1 vote
1 answer
442 views

'Insert Link' link is not pointing to Site Home item

We are having multiple SXA sites under a tenant. For all the sites, when we click 'Insert link' on General Link field, able to see Home item of current Site. But, for one site (whose language is de-DE)...
Manideep Yechuri's user avatar
3 votes
1 answer
3k views

LinkManager.Provider is deprecated in Sitecore 9, how to get the default provider then?

The following code works in Sitecore 8.2 but not in Sitecore 9: var provider = LinkManager.Provider; The Provider property is not available anymore in Sitecore 9 Sitecore.Kernel, what should I use ...
Tamás Tárnok's user avatar
1 vote
2 answers
261 views

Cache problems when generating links with the LinkManager class

I use the following block of code to generate the links of media items in a specific language: Sitecore.Links.UrlOptions urlOptions = Sitecore.Links.LinkManager.GetDefaultUrlOptions(); ...
Slrg's user avatar
  • 289
1 vote
2 answers
553 views

Canonical url generation not using the correct hostname

I am currently using a html helper to generate a canonical url but the problem is the server url. The url is fetched from targetHostName (please correct me if I am wrong) The problem arrives in the ...
Shabaaz Shaikh's user avatar
3 votes
2 answers
485 views

Language culture missing from url on post back

Language culture such as 'en' or 'en-gb' was initially present with a sitecore url. But after a post back, page returns with some validation errors and language culture is missing from url. What may ...
Hrishikesh T T's user avatar
0 votes
0 answers
100 views

Cross sites links are resolving as a context site link (Sitecore 9 Update 2) [duplicate]

I am having an issue in Sitecore 9.0.2 that cross sites links are not resolving properly. The link is resolved as a context site link and when I click on that link it gives me 404 so anyone has any ...
Ravindra S. Rathore's user avatar
0 votes
1 answer
803 views

Glass RenderLink not rendering right media url

Sitecore verison - 9.0.2 Glass version - 5.0.6.0 We are trying to use Glass @RenderLink to render a pdf media item, it's generating anchor tag with below path /sitecore/media-library/site-content/...
Dheeraj Palagiri's user avatar
4 votes
0 answers
163 views

Using Experience Editor on a multisite solution. Custom linkProvider to solve problems?

We have multiple sites in sitecore but all are edited by the same editors and they want to be able to edit it all in one place. The majority of our editors use EE. Problems: When you follow a link (...
Erik Melkersson's user avatar
3 votes
0 answers
266 views

How to let Sitecore 9 RTE Link Manager use "id" attribute instead of "name" attribute for anchors

When adding an anchor link in the Link Manager inside a RTE field in Sitecore 9, the attribute name is used. This is no longer supported with html5 according to W3Schools: The name attribute is ...
Peter's user avatar
  • 31
5 votes
1 answer
52 views

When should I use ScalableLinkProvider or ItemSearchLinkProvider?

I have noticed that the Sitecore.Buckets.LinkProviders namespace has 2 classes that extend the default LinkProvider: ScalableLinkProvider and ItemSearchLinkProvider. I cannot find any direct ...
Ben Golden's user avatar
  • 3,313
3 votes
1 answer
1k views

Omit bucket folders from page urls - linkprovider not working in SXA

I created a custom item resolver to remove/omit bucket folder item name from url. With this resolver we can access url from: www.xpto.com/folder/2018/08/06/15/40/page www.xpto.com/folder/page And ...
Pedro Luís's user avatar
4 votes
0 answers
158 views

UseDisplayName is not working after renaming language code from fr-CA to fr

I have renamed language code from fr-CA to fr, Added fr version to all my content Items. Now the French name in the URL is not displaying? How to correct it? Link Manager Setting:Web.Config <...
sindu's user avatar
  • 629
5 votes
2 answers
4k views

Sitecore multisite cross links not resolved with proper hostname

I've multisite solution setup, and sites config looks like below: <sites> <site name="localhost" hostName="local.com" scheme="http" notFoundItem="not-found" enableTracking="true" ...
nari447's user avatar
  • 407
0 votes
1 answer
2k views

LinkManager Adds /sitecore/content into the URL

I am dynamically constructing the left menu for the product View: @foreach (var item in Model.Children) { <div class="btn btn-default"> <a id="lnk-@...
sindu's user avatar
  • 629
0 votes
1 answer
1k views

Multilingual - Sitecore General Link Field Url Giving Embedded Language in Wrong Format

I have a requirement where my URL should be in format : http://domain/de-DE/pagename I have following settings done for my site: <setting name="Languages.AlwaysStripLanguage"> <patch:...
ravi kumar Mishra's user avatar
1 vote
1 answer
3k views

Override Media Manager to Change Url

I need to insert text for a media item when getting a media type of PDF by changing the GetMediaUrl method. This is for an RTE field. I went to override the MediaProvider, but found it was obsolete ...
RReilley's user avatar
  • 755
6 votes
1 answer
2k views

Language specific URLs with UseDisplayName and LinkManager

We have a site where I need to add hreflang on each page, linking to each language version of the page. <link rel="alternate" href="https://domain/pants" hreflang="en"> <link rel="alternate" ...
Thomas Bæk's user avatar
5 votes
3 answers
2k views

How to get item url without using Linkmanager?

Hello i need to get the url from a Sitecore ítem but without using the LinkManager class from Sitecore because i can't mock it. What is the best approach to do unit tests when i need information from ...
Samsung Note's user avatar
3 votes
0 answers
218 views

Multiple sites and url management

I'm having some problems configuring sitecore the way I need. I have 3 sites: Content Site1 Site2 Site3 Site1 url should be www.site1.com Site2 url should be www.site2.com Site3 url should be www....
Gamaliel's user avatar