I would like to use a custom render for a Content Reference Property (PageLink). Here is an example of the custom renderer:
[TemplateDescriptor(TagString = "MyCustomRenderer")]
public class PropertyPageReferenceCustomControl : PropertyPageReferenceControl, IRenderTemplate<ContentReference>
public override void CreateDefaultControls()
// I need todo some stuff here but this template is never rendered.
And how I am calling it from a control
<EPiServer:Property ID="Property1" PropertyName="PageLink" runat="server">
<RenderSettings Tag="MyCustomRenderer" />
I want to be able to manipulate the way the PageLink is rendered but with the above, my custom renderer is simple not used.
I have other custom renders working in the same project but for different types. i.e
[TemplateDescriptor(TagString = "UrlWithTitle")]
public class PropertyUrlWithTitleControl : PropertyUrlControl, IRenderTemplate<Url>
Can anyone see what I am doing wrong with the PropertyPageReferenceControl custom renderer?
Your render template is set to ContentReference and your class is inheriting from PropertyPageReferenceControl - is it possible that you need to use PropertyContentReferenceControl? (I don't use web forms, only MVC) I'm not sure if the PropertyPageReferenceControl works with ContentReference. I could be wrong though, check it out. Notice how your Url template descriptor is rendering for a Url and a PropertyUrlControl.
Initially, those where also my thoughts but no PropertyContentReferenceControl exists. Also, PageReference inherits ContentReference of which I have tried both in IRenderTemplate<T> without success.