wentz
wentz

Reputation: 700

Remove metadata from List item with placement.info in Orchard

I created two content types, Foods with the containable part, and Colors with the container part. I created a list of colors that contain foods inside them following Bertrand's example here: http://weblogs.asp.net/bleroy/many-ways-to-relate-orchard-things-part-3-lists

Example:
green: avocado, kale, spinach
red: strawberry, raspberry, ketchup

On the page for "green" and "red" I am trying to remove the metadata. I tried this code:

<Match ContentType="Food">
    <Match DisplayType="Summary">
        <Place Parts_Common_Metadata="-"/>
    </Match>
</Match>

And the metadata was still there, so I tried this code to make sure I didn't have any typos:

<Match ContentType="Food">
    <Place Parts_Common_Metadata="-"/>
</Match>

Again, the metadata was still there for the list view pages, but as expected it did remove the metadata from the display view pages.

I am able to remove the metadata through a Content-Food.Summary.cshtml but I know the preferred method is to use the placement.info file.

Is this possible? If not, is it a feature or a bug?

Upvotes: 0

Views: 108

Answers (1)

Hazza
Hazza

Reputation: 6591

There are two different views for the Metadata, one for the summary and one for the detail. This is good because it means you can customize how the metadata is displayed in the summary vs the detail, but slightly confusing when you are starting out.

So all you need to do is use this:

<Match ContentType="Food">
    <Match DisplayType="Summary">
        <Place Parts_Common_Metadata_Summary="-"/>
    </Match>
</Match>

Note the Parts_Common_Metadata_Summary

Upvotes: 2

Related Questions