How to remove items from a page?
Asked Answered
I

3

6

I have just downloaded and installed Orchard CMS and started to play with it. Created some widgets in zones, and created a blog and customized my top menu.

Now I want to do some modifications for my welcome page.. I want to remove the title field and the line where created date is shown, only to show the body. (This will only be for the welcome page. The other pages should not be affected)

How do I do this? What is the right approach?

Ity answered 4/3, 2011 at 14:22 Comment(0)
M
6

I had the same desire to remove the published date. In my case I wanted to remove them from ALL pages.

One way to to do this is to adjust the Placement of Shapes...

The Shape you need to influence the placement of is the Parts_Common_Metadata shape. To make it invisible you make the placement value equal to 'Nowhere'.

So I added this to a placement.info file inside my theme folder:

<Match DisplayType="Detail">
    <Place Parts_Common_Body="Content:before"
           Parts_Tags_ShowTags="Content:after"
           Parts_Comments="Footer"
           Parts_Common_Metadata="Nowhere"/>
</Match>
<Match DisplayType="Summary">
    <Place Parts_Common_Body_Summary="Content"
           Parts_Comments_Count="Nowhere"
           Parts_Tags_ShowTags="Nowhere"
           Parts_Common_Metadata_Summary="Nowhere"
           Fields_Common_Text="Nowhere"/>
</Match>

If you want this to apply only to certain content types you can wrap the above within a parent tag such as:

<Match ContentType="Blog"></Match>

I'm not sure how you would apply this only to the Welcome page though...

Matheson answered 7/3, 2011 at 16:0 Comment(1)
To apply only on the home page, you can use a Match with a Path="/" attribute.Tamarra
M
6

In case someone finds the response later and needs the mark up for removing the page title on the homepage, here it is:

<!-- Remove the page title from the homepage -->
<Match Path="~/">
    <Place Parts_Title="-" />
</Match>
Mohandas answered 1/1, 2013 at 19:52 Comment(1)
This is the correct response for the Welcome page specifically. Thank you.Puente
H
1

To edit the html itself/the views you have to edit the cshtml files. I still have to figure this out properly.

To just edit the content, in the Dashboard:

  • Click Widgets
  • Click Homepage under layers
  • You can now add any widget here into the homepage layer and it will only show on the homepage.

You can add html widgets to do some custom stuff.

Hope it helped.

Hawfinch answered 5/3, 2011 at 19:55 Comment(2)
thanks for the reply giddy. I am currently reading some docs for customizing a theme and editing templates, so guess I will be finding myself editing some cshtml files very soonIty
I also think that maybe placement.info will do the trick! Haven't tried it yet, thoughIty

© 2022 - 2024 — McMap. All rights reserved.