How to correctly leverage Content, Widgets and Layers in Orchard

81 views Asked by At

I have a number of pages in an Orchard CMS (v1.81 if thats relevant) that look like:

------------------------------
Header
------------------------------
Body Content Part 1
Info about a product
------------------------------
Some list structure with custom formatting
Here are 5 great reasons to use this product
------------------------------
Body Content Part 2
So you should buy this product - Call To Action
------------------------------
Footer
------------------------------

Header & Footer are common to the entire site, so I've added these as widgets on the Default Layer.

For the main body of each page, I have 2 options.

  1. Put all the content (part 1, the list, and part 2) in the main "Body" of the page editor.

OR

  1. Create a custom content definition for my list items, and use:

    • 3 widgets, a projection widget in the Content Area, + 2 HTML widget above and below for the part1 & part 2 content.
    • a projection content type + 2 HTML widget above and below for the part1 & part 2 content.

Option 2, seems like it makes more sense because I'm dealing with list content. But because of the reliance on a mixture of projection and regular content, I need to rely on html widgets.

This means I need a custom layer for just that page, and it's unintuitive for other content admins who review the page because they need to know to find the part1 & part2 copy under widgets and not under the content item itself.

Am I missing something here or do I have a fundamentally incorrect approach.

Is there a better way to mashup projection + page content without relying on widgets & layers (since this content won't be shared by any other pages).

1

There are 1 answers

0
Bertrand Le Roy On BEST ANSWER

The projection widget is just a widget that has the projection part. You can add the projection part to your own content item, if you first go to content definitions, edit the projection part and make it attachable. So option 3 is to add the projection part.

Alternatively, you can also create a custom part that takes care of the query you need to run.