This project is read-only.

Search Results Placement

Topics: Customizing Orchard, Troubleshooting, Writing themes
Nov 17, 2011 at 11:49 PM


I'm trying to hide fields in search results via file in my theme but it doesn't work.  It works for part.  In the below snippet the title will be surpressed but the taxonomy field will not. 

  <Match Path="/Search">
    <Place Fields_Contrib_TaxonomyField="-"/>
    <Place Parts_RoutableTitle_Summary="-"/>    
Any ideas?



Nov 18, 2011 at 12:03 AM

You might want to look at Shape Tracing to check you're targeting the right part. Some shapes render different versions for different display modes. You're targeting the correct "Summary" shape for RoutableTitle, but it's possible Taxonomy has one too. Shape Tracing will tell you the correct names of the parts currently displaying.

Nov 18, 2011 at 12:14 AM


I checked all that including the Shape Tracing and I don't see it as a different part.  Here's the content of the placement file for the Taxonomy module.  I don't see any indication of a different shape, do you?

  <!-- Location of field edition -->
  <Place Fields_Contrib_TaxonomyField_Edit="Sidebar:2.5"/>
  <!-- Display terms in front-end summaries -->
  <Match DisplayType="Summary">
    <Place Fields_Contrib_TaxonomyField="Content:after"/>

  <!-- Display terms in content item details -->
  <Match DisplayType="Detail">
    <Place Fields_Contrib_TaxonomyField="Content:5"/>

  <!-- Display terms in admin summaries -->
  <Match DisplayType="SummaryAdmin">
    <Place Fields_Contrib_TaxonomyField="Content:5"/>
  <!-- Display in admin -->
  <Place Parts_Taxonomies_Term_Fields="Content:2"/>
  <!-- Widget -->
  <Place Parts_Taxonomies_TermsWidget_Edit="Content:5"/>
  <Place Parts_Taxonomies_TaxonomyMenuItem_Edit="Content:5"/>
  <Place Parts_Taxonomies_TermsWidget="Content"/>  

Nov 18, 2011 at 12:39 AM

That all looks fine.

There's one thing you can try. This doesn't normally happen when your placement is in a theme, but it's worth a shot. Give your theme a dependency on Contrib.Taxonomy (in your Theme.txt manifest). What sometimes happens with modules is that Orchard doesn't know the order to process Placement files in, but by setting a dependency you can ensure that yours overrides the original. As far as I know themes should always take precedence, so it probably won't work, but it's worth checking before looking at anything else.