Hot answers tagged

15

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 completely OOTB. EDIT: updated to include a few additional ways to go about it Packager Doesn't require access to serialization tools. Package your item ...


14

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 working the way that you want then it's pretty straight-forward and low-effort to customize the solution to your needs. See below for details: Enabling ...


10

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/TargetsSearchPanelConfig In there, find the Filters section and then the Root field. Change the field to point at: /sitecore/client/Business Component Library/System/Texts/Targets ...


10

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={itemVersion}&sc_mode=edit The user will be redirected to the login page with the correct returnUrl parameter and then correctly redirected back to the item in ...


7

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 -Path "master:/sitecore/content/path/to/your/item" $linkDb = [Sitecore.Globals]::LinkDatabase $links = $linkDb.GetReferrers($item) foreach($link in $links) { ...


6

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 = "http" function Item-Report($i){ $fields | % { if($i.Fields[$_] -ne $null -and $i.Fields[$_].Value.Contains($phrase) -eq $true){ ...


6

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" item. 2) In the "Root" field of the "Filters" section, specify the "sitecore/client/Business Component Library/System/Texts/Targets" item. After this change, ...


6

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


5

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 Media Library (Title field is not filled automatically) Variant (pass through: File) Results in EE


5

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(Sitecore.Context.Item.ID, language); And then call: LinkManager.GetItemUrl(otherLanguageVersion, options);


5

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="LinkDatabase.MaximumBatchSize"> <patch:attribute name="value">1000</patch:attribute> </setting> </settings> <...


5

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(fieldname, new { text = " <em>Before the text: </em>" + linkField.Text }) More examples: https://marcotanainsights.wordpress.com/2017/10/05/tips-...


4

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. The Breaking Links dialog box appears. Press the Edit Links button. The Edit Links dialog box appears. In the Edit Links dialog box you will see the list of ...


4

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://www.sitecore.net/xmlconfig/"> <sitecore> <linkManager> <providers> <add name="sitecore"> <patch:...


4

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 url, bool forcePort) { if (url == (Uri) null) return string.Empty; string scheme = url.Scheme; string host = url.Host; string @string = ...


4

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 the 'Linked item' field unshared (versioned or unversioned) requires some changes in AliasResolver pipeline in addition to make it not shared. To make changes, ...


4

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.AssertString(alias, "alias", true); if (alias.Length > 0) { Item item = ItemManager.GetItem(FileUtil.MakePath("/...


4

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 to your fields and image items given that certain conditions are met: The Field Suite fields are defined in /App_Config/FieldTypes.config. Check this first. It ...


4

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 have no default rendering variant selected. You can still assign RV in Raw Values but I think this is not a solution Quick fix: Custom service Add missing ...


4

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 Sitecore 9.


4

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 { public class ExtendedLinkUrl : LinkUrl { public string GetUrl(string linkFieldXml, Database database) { if (string....


3

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 (item == null) { return string.Empty; } if (ID.IsNullOrEmpty(fieldID)) { throw new ArgumentNullException(nameof(fieldID)); } ...


3

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 from what it would be if you are trying to intercept all links on the site. If your links are all in link fields, I implore you to read the first section. If ...


3

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 expanded. You would then need to wrap the text of the all <a> elements which links to a pdf with the additonal markup you require, probably best done using ...


3

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 verify this behaviour. It will either work as you expect, or it will be a bug in Sitecore. The string url should be exactly as given as value in the Sitecore client. ...


2

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 then process folders inside App_Config/Includes folder in alphabetical order and files inside those folders. If you need to use a include file(i.e. ...


2

I ended up using config transformation, having different site urls for local build, qa build and production in my Sitecore.config, Sitecore.QA.config, etc.


2

1. Implement a custom token You can try to implement a custom token for that if you want to go on the safe way. Here is a great post how you can implement that. 2. Implement a custom field Possible solution could to use a custom field which is inherited from the default General Link field. Which is returning back the current item if it is empty. Here you ...


2

We had the same issue a while ago and solved it by using Nvelocity. Might not be the best solution (if there is a nicer one I would also love to see it) but it works. What I did: in your variant, don't use Field but Template (for a NVelocity template). In the template you can do something like this: #set ($url = $item.Fields.YourLinkField.ToString()) #if ($...


2

I'm not sure if there's a way using the helpers available in the view, but you could certainly replace a few layers of the renderField pipeline to look for any QueryStringItems data and append it to the links. You'll need to extend a few classes: 1. Sitecore.Pipelines.RenderField.GetLinkFieldValue using Sitecore.Pipelines.RenderField; public class ...


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