There are a few posts on this but I am new to Orchard and am having trouble finding a solution.
I would like to be able to provide an alternate wrapper to widgets, for instance I have implemented a search form in the header which is currently using Widget.Wrapper.cshtml in my current theme, wrapping the form in a section (I edited this for the theme)
and applies a heading / footer if required as per the default wrapper.
I have created a Widget-SearchForm.cshtml and have tried to apply control via the placement.info to test if the search form can be removed (only for testing to see if anything happened).
<Place Widget__SearchForm="-" />
This did nothing, presumably because the placement only effects elements in the content zone?
To remove the wrapping HTML I have updated the Widget-SearchForm.cshtml to include an update to the Model
Model.Wrap = false;
And updated the Widget.Wrapper.cshtml to check for this and apply unwrapped code.
@if (Model.Wrap != null && Model.Wrap == false)
/** extra display code removed **/
Is there a better way of applying a wrapper to a widget without effecting all widgets on site?