We’re rewarding the question askers & reputations are being recalculated! Read more.

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
30 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 ...
-1
votes
0answers
60 views

.html file extension on every sitecore page

I want page url: mysite/abc.html,or mysite/abc/bc.html in sitecore. I tried with the linkmanager provider pipeline overriding: 1.//Linkmanager override public class MyLinkProvider : Sitecore....
0
votes
0answers
28 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
42 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
397 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
112 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/...
2
votes
1answer
75 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 ...
0
votes
1answer
144 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
485 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
106 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
128 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
218 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
54 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
350 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
97 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
124 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
33 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 ...
2
votes
1answer
417 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
85 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 <...
4
votes
2answers
1k 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
839 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
733 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
1k 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 ...
5
votes
1answer
1k 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
1k 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
185 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
172 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
841 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
2k 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
3k 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 ...
13
votes
3answers
3k 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. ...
0
votes
1answer
67 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
869 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 ...
-1
votes
1answer
104 views

Is it possible to move “Display name” out of standard fields?

I want to configure my Link Manager to utilize the Display Name field when generating URLs, like so: <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <...
8
votes
1answer
232 views

Ramifications of removing encodeNameReplacement for dot (.)

Sitecore has a number of encodeNameReplacements in config OOTB, I fully understand what they are and what they do since I have previously posted about it. The issue we have is we have a number of ...
13
votes
4answers
16k views

How do you get the link for a media item?

I have an item in the media library in Sitecore and I want to place a link to that item on the site. How do I properly get the link for that media item?
12
votes
2answers
689 views

Create link as CD from CM

We have a Sitecore installation with a content management server and a content delivery server. Now: I have an item, for which I want to create a link (for sending in an email). The link should be ...