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
1answer
38 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/...
0
votes
0answers
18 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 ...
1
vote
1answer
49 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 ...
1
vote
0answers
33 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 ...
0
votes
0answers
58 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....
0
votes
1answer
173 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 ...
2
votes
1answer
202 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 ...
0
votes
1answer
33 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 "...
0
votes
0answers
28 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 ...
2
votes
3answers
377 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 ...
0
votes
1answer
287 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?
1
vote
1answer
358 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 ...
1
vote
0answers
61 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 ...
1
vote
1answer
44 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'...
2
votes
1answer
231 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 ...
1
vote
0answers
60 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 ...
0
votes
1answer
132 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/...
2
votes
1answer
360 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....
1
vote
2answers
485 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 ...
0
votes
0answers
73 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-...
0
votes
1answer
86 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 ...
0
votes
2answers
1k 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 ...
0
votes
0answers
296 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/...
3
votes
1answer
223 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 ...
1
vote
1answer
267 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)...
3
votes
1answer
2k 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 ...
1
vote
2answers
206 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(); ...
1
vote
2answers
279 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 ...
3
votes
2answers
352 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 ...
0
votes
0answers
94 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 ...
0
votes
1answer
641 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/...
4
votes
0answers
130 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 (...
3
votes
0answers
207 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 ...
5
votes
1answer
41 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 ...
3
votes
1answer
837 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 ...
4
votes
0answers
122 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 <...
5
votes
2answers
3k 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" ...
0
votes
1answer
1k 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-@...
0
votes
1answer
935 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:...
1
vote
1answer
2k 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 ...
6
votes
1answer
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" ...
5
votes
3answers
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 ...
3
votes
0answers
203 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....
0
votes
1answer
243 views

displayName for each language is not used by LinkManager [duplicate]

For an item I have 2 version for 2 languages with a different displayName for each. The displayName are : Item_01_EN for the EN version Item_01_FR for the FR version Now the problem is, when I use ...
4
votes
1answer
1k views

Sitecore LinkManager in PowerShell generate wrong protocol

I have next powershell code for getting page url by item function Get-ItemUrl($item){ $urlOptions = [Sitecore.Links.LinkManager]::GetDefaultUrlOptions() $urlOptions.AlwaysIncludeServerUrl = $...
7
votes
1answer
3k views

Is there any way to add the custom Link manager provider just for a particular site

I am working with a multi-lingual multi site solution and I come across a case where I need to set a different link manager provider settings for only one of the sites in my solution. Is there a way ...
6
votes
1answer
5k views

How to change language code in URL

We have a multi language site with English and Thai and I need to change the default language code in URL for the Thai pages. eg: mysite.com/th-th/about should become mysite.com/th/about My code ...
14
votes
3answers
5k views

LinkManager returning inconsistent Server Url

So, I have a rather complex issue to detail out here. the TL;DR is that Link Manager is returning inconsistent results in the GetServerUrl() method when given what appears to be the same parameters. ...
1
vote
1answer
88 views

Save multi values to image library with link reference

My question might be a little complex, but I appreciate any help: I am using SitecoreFieldSuite by Velir, in my Sitecore 8 solution. Officially, SitecoreFieldSuite isn't supported in Sitecore 8, but ...
4
votes
2answers
2k views

Create Sitecore Link with Powershell

I'm working on some reports using Sitecore Powershell Extensions. One requirement is to provide the public URL for various Sitecore items. I'm thinking this isn't really possible via Link Manager ...