1
votes

How do I override the zone-navigation zone in Orchard on the main blog page only. I'd like to leave the blog post page alone.

I would like to edit the Menu (remove it) but keep the menu on the blog post pages.

Thanks.

1

1 Answers

2
votes

You just need to put that menu widget in a layer that only applies to blog post pages. I don't think there is a built-in layer rule for content types, but you could implement one. See IRuleProvider in the Orchard.Widget module. Alternatively, you could just use the url rule if there is something consistent in the url for your blog posts. There is a link to create a new layer in the widgets admin area. Your rule would look something like this...

url '~/MyBlog*'

Then just put your widget in that layer.

Additionally, if you don't want any of the zone to be rendered when there are no shapes in it, make sure to check the Model.ZoneName for null in your Layout.cshtml from your theme.

@if (Model.Navigation != null) {
  <div id="navigation">@Display(Model.Navigation)</div>
}