|
|
By default the Page Title and Date-time of last modification get injected into the body of the page, at least when using the default TheThemeMachine.
Where is this occurring and how do I disable it?
|
|
|
Coordinator
Feb 16, 2011 at 11:18 PM
|
The title is injected as shape Parts_RoutableTitle by the RoutePartDriver in Core/Routable. The date is injected as part of Parts_Common_Metadata by the CommonPartDriver in Core/Common.
You can suppress the display of each shape from your placement.info file by placing each of the shapes in the "-" black hole zone.
|
|
|
|
|
Thank you Bertrend. I also discovered I could do it in my theme's site.css file as follows:
/* Hide the page title (in body) and date published */
.content-item header h1 {display:none;}
.content-item .metadata .published {display:none;}
I like the idea of using the placementinfo file better, so I looked at:
http://www.orchardproject.net/docs/Anatomy-of-a-theme.ashx
which states "A theme can modify where shapes are rendered by including a placement.info file at the root of the theme's folder."
I tried placing the following in the root of my theme but it did not work:
<Placement>
<!-- available display shapes -->
<!--
Parts_RoutableTitle
Parts_RoutableTitle_Summary
Parts_RoutableTitle_SummaryAdmin
-->
<Place Parts_Routable_Edit="Content:before.5"/>
<Match DisplayType="Detail">
<Place Parts_RoutableTitle="Header:-"/>
</Match>
<Match DisplayType="Summary">
<Place Parts_RoutableTitle_Summary="Header:-"/>
</Match>
</Placement>
What did I do wrong?
|
|
|
Coordinator
Feb 17, 2011 at 12:40 AM
|
You do not want to send markup to the browser that you are not going to display. CSS is entirely the wrong way of doing that except if that markup is going to have some hidden function on the client side.
Try this:
<Placement>
<Match DisplayType="Detail">
<Place Parts_RoutableTitle="-"/>
</Match>
<Match DisplayType="Summary">
<Place Parts_RoutableTitle="-"/>
</Match>
</Placement>
|
|
|
|
|
That did the trick. I totally agree that CSS is not the best way to go.
I think I need to go to the bookstore and purchase "Orchard for Dummies" ;-)
|
|
|
|
|
Guys, this is just what i was looking for also. thanks
would actually be a nice setting to include from the admin section as well, as the date/time info will not be desired for a lot of pages.. it is more useful in a blog post etc.
|
|
|
|
|
How can I find out the display shapes so I now what I can throw away?
|
|
|
Coordinator
Feb 25, 2011 at 4:36 AM
|
You can look at what parts you have on your content type and track down the drivers (that's where those shapes are getting created. In Orchard 1.1, we are shipping a tool that shows you all the shapes that are being displayed and what alternates are available
for them.
|
|
|
|
|
So the placement.info file goes in the root of the theme, correct? If I follow your earlier example, that hides the title and not the date.
|
|
|
Coordinator
Feb 25, 2011 at 4:51 AM
|
The date is in another shape:
Parts_Common_Metadata
|
|
|
|
|
That worked. Can't wait for 1.1 to get that tool. Guess I won't bother looking into building something for it.
So, my Placement file looks like this:
<Placement>
<Match ContentType="Page">
<Match DisplayType="Summary">
<Place Parts_Common_Metadata="-"/>
</Match>
<Match DisplayType="Detail">
<Place Parts_Common_Metadata="-"/>
</Match>
</Match>
</Placement>
I am singling out the Page, because I don't want to hide the date from other elements like Blog posts. I would like to remove it from the Blog "Page". How can I do that?
|
|
|
Coordinator
Feb 25, 2011 at 5:04 AM
|
ContentType="Blog"?
|
|
|
|
|
Ok, I to am trying to use this technique and its not working. I want to hide the Title and Date from all pages including the Home Page. I am using the Theme Machine, can anyone help me?
|
|
|
|
|
Specifically, I'm trying to remove it from the home page.
|
|
|
Coordinator
Jan 18 at 6:21 PM
|
Show exactly what you tried and tell us how it failed.
|
|
|
|
|
I tried:
<Placement>
<Match Content="Page">
<Match DisplayType="Detail">
<Place Parts_RoutableTitle="-"/>
</Match>
<Match DisplayType="Summary">
<Place Parts_RoutableTitle="-"/>
</Match>
</Match>
</Placement>
|
|
|
Developer
Jan 18 at 8:54 PM
|
What Orchard version are you running on?
|
|
|
|
|
1.6
|
|
|
Coordinator
Jan 18 at 8:59 PM
|
Where did you put the file?
|
|
|
|
|
placement.info under the theme folder
|
|
|
Developer
Jan 18 at 9:19 PM
|
If memory serves me right, wasn't the Parts_RoutableTitle shape generated by the RoutablePart, which was deprecated since 1.4?
|
|
|
|
|
Ok, how can I remove the Title and Date from Page Headers? Any ideas?
|
|
|
|
|
<Place Parts_Title="-" />
<Place Parts_Common_Metadata="-"/>
no?
|
|
|
Coordinator
Jan 19 at 4:39 AM
|
Good catch.
|
|
|
|
|
Thank you, that worked.
|
|
|
|
|
I have another question. If I want to make a whole zone, such as Content Zone not show up for a given page, anyone have an idea on how to achieve this?
|
|
|
Developer
Jan 20 at 3:16 PM
|
Do you mean the "global" Content zone on the Layout shape, or the "local" Content zone on a content item shape?
|
|
|
|
|
I don't think there is a way to hide an entire zone. Just hide the separate components via the placement file.
|
|
|
Developer
Jan 20 at 6:00 PM
|
Hiding global zones could be done by overriding the Layout template.
Check this out
http://weblogs.asp.net/bleroy/archive/2011/01/10/orchard-shapeshifting.aspx
http://weblogs.asp.net/bleroy/archive/2011/06/06/getting-started-with-custom-themes-in-orchard.aspx
|
|
|
|
|
Ok, so I want to remove the Title and Date off all pages except the Blog and Blog post page. I use this to remove the Title and Date globally:
<Match Content="Page">
<Match DisplayType="Detail">
<Place Parts_Title="-" />
<Place Parts_Common_Metadata="-"/>
</Match>
</Match>
But that removes it from the Blog pages also, how to achieve this?
|
|
|
Developer
Feb 18 at 11:44 PM
|
On the first line, try changing the "Content" attribute to "ContentType".
|
|
|
|
|
That worked. Thanks a lot my friend.
Regards,
Tommy Havens
|
|