Is there a way to get a specific field name from a template with several sections to a FieldRenderer control?
F.ex. I have a template with the sections “Data” and “Data2”, both have a single-text-field called “Text”. Is there a way to make my FieldRenderer get the field “Text” in section “Data2”
It would be nice if one of the below suggestions worked:
<sc:FieldRenderer ID="test" runat="server" FieldName="Text" Section="Data2" />
<sc:FieldRenderer ID="test" runat="server" FieldName="Data2/Text" />
BR Larre
Though it’s developed like this on purpose(we don’t want Sitecore developers to waste time on section-names), I think it does make sense to include such a thing.
Let me list this as a feature request.
If you want to have this working right know, you should first understand how the fieldRenderer is working. It kicks off a pipeline called ‘renderField’.
In the second step of this, it’s reading the fieldvalue:
Replace that one with your own custom class with something like this:
Something in the line of:
But now with error checks 🙂