Search module enabled?

Topics: Writing themes
Jan 24, 2012 at 5:32 PM

Is there a way in my layout.cshtml file to determine if the Search module has been enabled or not so that I can dynamically control the display of my own custom Search box? Thanks

Jan 24, 2012 at 6:15 PM
Edited Jan 24, 2012 at 6:15 PM

Think of it the other way around; push something into Layout rather than trying to pull anything into it.

So you could write a filter and have it as part of your module; when enabled it pushes a Search shape into the layout (WorkContext.Layout.SomeZone.Add(shape)).

You can give it a dependency on Orchard.Search and then it'll only be enabled at the same time.

Jan 24, 2012 at 6:43 PM
Edited Jan 24, 2012 at 6:44 PM

Gotcha...I'll do the push similar to the way BadgeOfHonor is pushed.

What can I use for a condition check though to determine if the Search module is enabled? I don't want to push the shape out if the module hasn't been enabled. This is for a theme btw, not a module. Thanks!

Jan 24, 2012 at 7:17 PM
Put it in a feature of its own with a dependency on search... That way it can only be active at the same time.



psenechal <notifications@codeplex.com> wrote:


From: psenechal

Gotcha...I'll do the push similar to the way BadgeOfHonor is pushed.

What can I use for a condition check though to determine if the Search module is enabled? I don't want to push the shape out if the module hasn't been enabled. Thanks!