Hot answers tagged

15 votes
Accepted

Removing all references to an item using OOTB tools

Not quite. But here's what I would do. Serialize your item Delete the original item, instructing Sitecore to delete all references Deserialize your item Requires access to the Developer Tab, but is ...
user avatar
  • 24.4k
14 votes
Accepted

Cross-site links not resolving correctly in RTE fields on multi-site environment

This is a pretty common business-case in Sitecore multi-site projects, and fortunately there is pretty good support for cross-site links OOTB. If what you need isn't available OOTB or if it isn't ...
user avatar
10 votes
Accepted

Setting the target on an internal link field

This is a known issue with the General Link Field. To fix it open the Core database and navigate too: /sitecore/client/Applications/Dialogs/InsertLinkViaTreeDialog/PageSettings/...
user avatar
  • 18.9k
10 votes
Accepted

How to deep link into Experience Editor so that user is redirected after login?

Instead of linking to an item with an id parameter, instead link to the full item URL with sc_mode=edit parameter set, e.g. {cmsHost}/path/to/item-page?sc_lang={itemLanguage}&sc_version={...
user avatar
  • 13.7k
7 votes
Accepted

How to get a list of all external links

Solution 1. SPE I recommend using Sitecore Powershell Extensions for that. Example code snippet: $fields = "Content", "Title" $startPath = "/sitecore/content/Playground/Playground/int/Home" $phrase ...
user avatar
7 votes

Removing all references to an item using OOTB tools

This doesn't satisfy the out-of-the-box requirement but may prove useful if that criteria doesn't apply in other situations. Here's a method using Sitecore Powershell Extensions: $item = Get-Item -...
user avatar
  • 4,134
6 votes

Setting the target on an internal link field

This is a know bug, please perform the following steps in the "core" database: 1) Navigate to the "/sitecore/client/Applications/Dialogs/InsertLinkViaTreeDialog/PageSettings/TargetsSearchPanelConfig" ...
user avatar
  • 17.8k
6 votes

Sitecore General Link linking to itself (internal item) by default

Try putting the below in the standard value's raw values: <link text="link text" linktype="internal" class="" title="" target="" querystring="" id="$id" anchor="" />
user avatar
5 votes
Accepted

How to display PDF link in Sitecore page

Did you create variant items under reference field? You need to display something in order to render a link. It works fine on my machine. Here are screenshots with the setup: Template Content ...
user avatar
5 votes
Accepted

Sitecore multisite cross links not resolved with proper hostname

I've had to add urlOptions.SiteResolving = true in my LinkProvider override and my GetItemUrl extension to get this to work properly. This is in Sitecore 8.2 and older versions, not sure about ...
user avatar
  • 66
5 votes
Accepted

Language specific URLs with UseDisplayName and LinkManager

You're still trying to generate link to the item version which is in your language. Try getting the other language version first: var otherLanguageVersion = Sitecore.Context.Item.Database.GetItem(...
user avatar
5 votes
Accepted

Link Browser doesn't show all child items from Tree?

I figured this out. I made the update to change the value of LinkDatabase.MaximumBatchSize to 1000 as suggested and it didn't work. <sitecore> <settings> <setting name="...
user avatar
5 votes
Accepted

How can I append HTML within and before the text of a rendered Link Field?

You'd basically want to override the text element in the field renderer: Something along these lines: @{ var linkField = (LinkField) Model.Item.Fields[fieldname]; } @Html.Sitecore().Field(...
user avatar
4 votes

Removing all references to an item using OOTB tools

Tricky answer : Please perform the following steps: 1. Open the Content Editor application. Select the item, links on which you want to delete. Press the delete button in the home tab on the ribbon. ...
user avatar
  • 17.8k
4 votes

Custom Link Provider is not overriding

Please verify that your patch file is patching correctly. Since you do not see it in your showconfig.aspx, most likely your patch file is not configured correctly. <configuration xmlns:patch="http:...
user avatar
4 votes
Accepted

Obtaining a site url with correct binding port dynamically

Sitecore.Globals.ServerUrl is set in the Globals.Load function by calling WebUtil.GetServerUrl(HttpContext.Current.Request.Url, false). The code for that is: public static string GetServerUrl(Uri ...
user avatar
  • 18.9k
4 votes

Alias are not coming from language specific item version

Here is an explanation. Reason: 'Linked item' field of the 'Alias' template was designed to be shared in all languages. For this, the invariant language is used to retrieve alias items. To make ...
user avatar
  • 1,467
4 votes

Alias are not coming from language specific item version

You need to extend Sitecore.Data.AliasResolver class. You need to modify just this method in this class: public virtual LinkField this[string alias] { get { Error....
user avatar
  • 17.8k
4 votes
Accepted

Save multi values to image library with link reference

Well, I've been in the archives ;-) Now I cannot say for sure, the solutions I list here will still be applicable in Sitecore 8. What I can say though, is that Sitecore will add LinkDB references ...
user avatar
  • 24.4k
4 votes
Accepted

Can't drag & drop SXA components in overlay content (through experience editor)

This is a known issue in SXA 1.5, it was fixed in SXA 1.6 so if you can I highly recommend you to upgrade. Rendering Variants do not work on Overlay items thus you cannot see renderings because they ...
user avatar
4 votes
Accepted

Creating LinkField from XML

In theory you can extend LinkUrl class and pass the xml instead of the LinkField object like that: using System.Xml; using Sitecore.Data; using Sitecore.Xml.Xsl; namespace My.Assembly.Namespace { ...
user avatar
3 votes

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

For starters, you should use the Sitecore.Data.Fields.LinkField class and GetFriendlyUrl(). To rewrite what you have currently: public static string LinkFieldurl(this Item item, ID fieldID) { if (...
user avatar
  • 1,206
3 votes
Accepted

RTE Inserting/Rendering Link Appending Text

The Sitecore way to replace the text in a Rich Text field would be to create a custom processor in <renderField> pipeline, insert it before RenderWebEditing to ensure all links in fields are ...
user avatar
  • 13.7k
3 votes

I need to override the SitecoreFieldLinkMapper, how do I ensure that the mapper isn't ran twice?

You can replace the standard link resolve in the Glass Dependency resolver. This is done in the CreateResolver method: public static IDependencyResolver CreateResolver(){ var config = new ...
user avatar
3 votes
Accepted

Set Data Attributes for Links to Certain Items

From the way that the issue is described in your post, the actual links that you are trying to intercept are a bit ambiguous. If your links are all from link fields, then the answer is very different ...
user avatar
3 votes
Accepted

Richtextbox (RTE) link.aspx custom link provider/pipeline

Whatever you're doing, I think you're off doing something pretty far removed from established Sitecore Best Practices. That said: string richText = yourItem["rich text field"]; string expandedLink = ...
user avatar
  • 24.4k
3 votes
Accepted

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

The vanilla Sitecore code to render a General Link field containing this external Url would be: LinkField lf = myitem.Fields["name of your field"]; string url = lf.GetFriendlyUrl(); You should ...
user avatar
  • 24.4k
3 votes

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

From what I understand, you want to implement custom logic for generation of internal links added by content authors in Rich Text fields. If that's the case, you need to change the logic of ...
user avatar
3 votes
Accepted

Sitecore 9 CMS - Add an Image to a Link in the Footer

From the question, I can see that there is no existing implementation for your requirements. So there is no anyway for you, you need to write Sitecore code. Here the Link field is a General Link field ...
user avatar
2 votes

Custom Link Provider is not overriding

Also to note that Sitecore first processes include files directly inside the App_Config/Includes folder in alphabetical order (technically, the order returned by the Directory.GetFiles() method) and ...
user avatar
  • 1,467

Only top scored, non community-wiki answers of a minimum length are eligible