Parts_Common_Metadata - hiding in theme or module

Topics: Troubleshooting, Writing modules
Feb 17, 2012 at 11:58 PM

Coming to grips with placement.info...

Why does this work in a theme but not in a module?

    <Place Parts_Common_Metadata="-"/>

In my module I'm successfully experimenting with other shapes like Parts_Title but not Parts_Common_Metadata for some reason.  But it works in a theme's placement.info

Coordinator
Feb 17, 2012 at 11:59 PM

How would Orchard know which module has the most important placement file? Themes on the other hand should clearly win.

Feb 18, 2012 at 12:12 AM

I see :-)  So if there's no mechanism to specify that my module wins, then the assumption is that overriding placements is only the job of the theme, ie: it's just a display/layout issue. 

I suppose I might argue that in my module the Metatdata adds no value to the display of certain content types & infact might cause confusion (as per Kevin's example of the event date metatdata on the Pluralsight course) so I'd like to be able to force it to be hidden for all themes.  But then I suppose I could override the template with an empty template.

Coordinator
Feb 18, 2012 at 12:34 AM

Well, you'd have to specify a match in that scenario, which might actually work.

Feb 18, 2012 at 8:03 AM

You can make your module win by setting a dependency on Common in your Module.txt - then its Placement will always get applied after the Common module.

Feb 18, 2012 at 10:49 AM

Thanks for the hot tip, that worked :-)