In the General Link
field content author will set some class.
I want to change the class while rendering, so I used the reflector and got the code of Link.cs
and trying to extend the PopulateParameters
method and looks like this.CssStyle
and this.CssClass
are always blank. Is there any way to get the value of class entered in the General Link
field?
Cast your field to
LinkField
class and useClass
property:**EDIT: **
If you want to change behaviour of Sitecore
sc:link
to change css class of every link, you need to add your own processor to therenderField
pipeline:and register it before
GetLinkFieldValue
processor: