Frage

How can I create a sidebar in Umbraco that is common to all pages that uses a specific template, but is still editable for a editor?

If I simply create the sidebar in the template I would have to edit it myself every time they want something changes.

On the other hand if I create a sidebar field in the document type and map it to the sidebar in the template the editors have to recreate the same sidebar content for every page.

War es hilfreich?

Lösung

It's possible to use the recursive property on your template.

Basically what you do is on your homepage, or which ever root node for the section you want to use, you create the property which will contain your sidebar text. I would suggest the homepage.

Then you add a page field on the template with the attribute recursive=true

You can add the page field by adding the property a follows

enter image description here

This would result in a field that looks something like the following

<umbraco:Item field="category" recursive="true" runat="server" />

In my example, the property on the homepage which is being used is category.

Then any page which exists below the homepage, if it doesn't have a property with the same alias, then the value from the homepage will be taken.

A very useful feature :)

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top