How can I hide the page heading on the home page?

Topics: Customizing Orchard, Writing themes
Mar 12, 2012 at 6:55 AM
Edited Mar 12, 2012 at 6:55 AM

I am building a site where I am mostly using widgets for the content of the homepage. What's the best way for me to specify that I would like to hide the heading <h1> tag on the page? I know I can use CSS to hide the H1 tag as one approach but specific to Orchard, where and what's the best way to do this?

Mar 12, 2012 at 2:46 PM

I think what you're referring to is the Title shape, which means you're looking for Placement (the Placement.info file in your theme).

To hide (i.e. not even render) that shape put this in your Placement.info file:

<Place Parts_Title="-"/>

To be more specific, you can nest that inside of a Match element like this:

<Match ContentType="Page">
  <Place Parts_Title="-"/>
</Match>

That will only affect Page content items. Or you can match on the path, and you can also nest Match elements. So if you only want to hide it for Page content items which are the home page you can use something like this:

<Match Path="~/">
  <Match ContentType="Page">
    <Place Parts_Title="-"/>
  </Match>
</Match>

Mar 12, 2012 at 5:28 PM

Perfect. I opted for the 3rd option. Thanks a bunch.