9 votes
Accepted

Adding Attributes to Rendered Link Programmatically

We have just recently implemented a solution for this, to handle links to a specific template (Modal) differently. We created a custom renderField pipeline processor like the following: namespace ...
Kasper's user avatar
  • 2,156
4 votes

Custom field type has empty string for FieldTypeKey in RenderPipelineArgs; how to populate?

Quick answer You can populate it in the field "Type" of your template's field item. Still confusing? Here is an image to help you The image above shows how the type is set in the default ...
André Andrade's user avatar
4 votes
Accepted

Making field of type 'File' editable in Experience Editor with Glass Mapper

Like Mark Cassidy said, no you can't do this with Glass. However you have another option in the Experience Editor (although not specific to Glass), if you want to give users the ability to still edit ...
Dylan Young's user avatar
  • 4,314
4 votes
Accepted

How to pass data between renderings in sitecore 9.0.1?

a) Adding proper references You can find "ContextService" in Sitecore.Mvc namespace / assembly. Just add below using to your razor view: using Sitecore.Mvc.Common; and in your project references ...
Peter Procházka's user avatar
3 votes
Accepted

How to render a Link Field with inner elements in .cshtml

This format can be used: @using Sitecore.Mvc.Helpers @{ Sitecore.Data.Fields.LinkField linkField = sourceItem.Fields["Link1"]; // Do some validation } ... @Html.Sitecore().BeginField("...
Marcel Gruber's user avatar
3 votes
Accepted

Date in rendering variants

If you don't want to display time, but just a data simply change the Date format. Render if empty is to render field renderer in the Experience Editor even if the field doesn't have a value. Thanks to ...
Dawid Rutkowski's user avatar
3 votes
Accepted

Make a field(RTE) disable(readonly) and enable(editable) on toggle of checkbox in Content Editor

You could perhaps do this by injecting some custom JavaScript into content editor like so with a pipeline: Pipeline var page = HttpContext.Current.Handler as Page;   foreach (string script in ...
Adam Seabridge's user avatar
2 votes

Cascading Droplist field in Sitecore

Yes, you can implement a custom field. You have several ways to do this. One of our project I used iframe field type for it. In my opinion this is the easiest way for complex custom fields. Actually I ...
Tamás Tárnok's user avatar
2 votes

Making field of type 'File' editable in Experience Editor with Glass Mapper

No Not with Glass Mapper, not using vanilla tools and APIs. Looking at the official Sitecore Documentation for this (Edit content directly on the page) we learn that these are the fields are supported ...
Mark Cassidy's user avatar
  • 25.1k
2 votes

Image not rendering in SXA PageList variant

1) One option would be to use Promo renderings + column and row splitters. I would split content first into 2 (or number of rows you need) rows with row splitter: and then I would put column ...
Peter Procházka's user avatar
2 votes
Accepted

FieldRenderer.Render for controller Rendering not "working"

It seems that I was using the wrong Context Item when I use this RenderingContext.Current.Rendering.Item everything is working fine. Would be nice to know what is the difference between these two ...
squadwuschel's user avatar
  • 1,165
2 votes
Accepted

Retrieving item from Droplink Rendering Parameter

The .Parameters property on the Rendering is just a key value pair and the value is the string containing the raw value for the field type. public string this[string parameterName] { get { ...
Richard Seal's user avatar
  • 20.4k
2 votes
Accepted

Rendering a Sitecore field in MVC with an enclosing tag and class

The reason why your code doesn't work for you: @Html.Sitecore().Field(Templates.PageText.Fields.PageTextHeading.ToString(), Model.Item, new { @class = headingStyle, EnclosingTag = headingRank }) is ...
Marek Musielak's user avatar
  • 23.6k
2 votes

How to get Sitecore Updated Field only?

Sitecore doesn't give any option OOTB on field level. Sitecore manages the Revision field for each item that has any update, Sitecore's smart publish is based on this field. You need to compare this ...
Mahendra Shekhawat's user avatar
2 votes

How to get Sitecore Updated Field only?

Assuming that there is new version created when items are being edited, you can take the latest version and previous version and compare each field. Item originalItem = newItem.Database.GetItem(...
Marek Musielak's user avatar
  • 23.6k
1 vote

How to add custom data attribute on Sitecore general link fields

You need to extend General Link field in Sitecore that way you can provide the ability to authors so that they can configure custom data attribute values. follow the steps to add extending general ...
Sumit Helaiya's user avatar
1 vote

How to render a Link Field with inner elements in .cshtml

If you know the HTML already and also link field is specific no other changes then easy solution similar to Debu suggested - @Html.Sitecore().Field(GLink.Fields.Link.ToString(), Model.Item, new ...
Yogesh Sharma's user avatar
1 vote

How to render a Link Field with inner elements in .cshtml

Regarding the previous answer - Try to write an extension. You will end up in a position to reuse this functionality everywhere else, without writing the same stuff again and again public static ...
Philippe Bénard's user avatar
1 vote

How to render a Link Field with inner elements in .cshtml

One very simple way would be: @Html.Sitecore().Field(linkfieldName, new { text = "something" })
Debabrata Biswas's user avatar
1 vote

RenderingContext is null

Apologies for the Short answer. What you can try to implement is to use PageContext.Current.Item which will give you the Current page item or RenderingContext.Current.Rendering.Item Hope this helps!
Abhay Dhar's user avatar
  • 1,655
1 vote

Computed Index field as a rendering variant

There is no out-of-the-box variant definition item to fetch content from an index. But you can create it yourself. One way would be to use NVelocity. A nice blog post on how to extend that can be ...
Gatogordo's user avatar
  • 20k
1 vote
Accepted

How to get first child of an item in content tree?

You can use Maximal number of results field for this:
Dawid Rutkowski's user avatar
1 vote
Accepted

Image not rendering in SXA PageList variant

You should not use the Image items directly as datasources. To display images, the page list will look for an Image field and not for a Media field. One possible solution would be to create a ...
Gatogordo's user avatar
  • 20k
1 vote
Accepted

FieldRenderer not rendering an image

Your code looks correct, so long as the Sitecore.Context.Item is the item that you took a screenshot of in the experience editor. Otherwise, you should also set the Item preoperty of those <sc:...
Zachary Kniebel's user avatar
1 vote
Accepted

Partial LinkField for Sitecore 8.1 rev. 160302

No, this is not doable with the existing General Link Field. Your options are: Have a Single Line Text field for first part, and generic link for the second part Use Rich Text Custom Field Type (...
Jarmo Jarvi's user avatar

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