Are layers the best/only way to customize widget content per-page?

Topics: General
May 21, 2012 at 1:31 PM

I'm migrating some content to a new Orchard site from a site built using another CMS. In the other CMS, it was convenient to customize widget content for each page. As such, in the existing site there are 28 pages (of 66 total) that have associated widget content.

I know that I could create layers for each of those 28 pages and associate the widget content that way, but that seems like a lot of layers. Is there a way to achieve the same result without creating all those layers?

I'm certainly not averse to writing some custom code to achieve the objective, but the site content will be maintained/updated by a non-coder.


May 21, 2012 at 5:00 PM

Maybe what you need in the Orchard world is a specific content type, with Body, Title and Autoroute parts, like Page, but also a specific text field called "Description" for instance. Then you can create a custom layout for this content type, likie Layout-SuperPage.cshtml, and use the field from this content item, placing it in the zone you want.

May 21, 2012 at 8:33 PM

I had been wondering if a custom content type could help me to solve this problem, but I'm only just beginning to familiarize myself with the various aspects of Orchard. At this stage, I often find it difficult not to latch on to the obviously cool and powerful feature and try to use it to solve all my problems, even when simpler solutions are at hand.

Do I understand your suggestion correctly in that this new content type would contain the primary content of the page as the "Body" and content for other zones as additional fields? I'm not sure I need this, but would a text field admit markup? Or would I decide this when configuring the layout? And supposing it did, would there be a way to enable the rich text editing experience for these extra fields?

Thanks again.