Question

I have 2 data template fields "title" and "id", used for the HTML page title and the id attribute in the body tag respectively. When the page is viewed using Page Editor, Sitecore attempts to render editor controls on these items and because they are outside of the main form tag, controls don't get rendered correctly. I don't need these to be editable in the Page Editor.

  1. What's the best approach/solution to handle fields like these?
  2. Is hiding these 2 template fields from the Page Editor a solution?
  3. If so, how do you hide the fields from the Page Editor and still have it available on the Content editor (so we can still edit it within the Content editor)?
Was it helpful?

Solution

In Page Editor, all you should need to do is render their values without a FieldRenderer. e.g, bind the field values to a standard .NET control. Or use a scriptlet -- <%=Sitecore.Context.Item["Title"]%>

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top