This project is read-only.

Page title display elsewhere on website

Topics: Customizing Orchard, General
May 1, 2013 at 3:27 PM

I would like the page title to display elsewhere on my website.
The position I would like it to be is within a HTML widget in the BeforeMain zone but I am not sure where in the code to add this. I know that the code for Page Title is @Model.Title Please can someone tell me where to add this?

May 2, 2013 at 1:44 PM
Can anyone help with this please? I am guessing I need to create a new shape template for the area where I want to add Page Title but my create button (on Shape Tracer) is not working.

Tx Kirsty
May 2, 2013 at 1:57 PM
By "page title" do you mean the branding that displays in the header? That one is displayed by the Branding shape (search the solution for Branding.cshtml from the Navigate To window - Ctrl + ,). Probably the most simple solution to your issue would be to override Branding in your theme by having an empty file with the same name, then adding your site's name as part of a html widget.
May 2, 2013 at 2:00 PM

Hi, thanks so much for you reply.

By ‘Page Title’ I mean the page name such as home, property, development etc.

Any ideas please?

May 2, 2013 at 2:24 PM
I managed to not set the Page Title to not display at the top of each page by adding the following code <Place Parts_Title="-"/>in the file but want it to appear as detailed above. Any ideas please?
May 2, 2013 at 2:24 PM
I see. Than just adjust the placement of Parts_Title (the shape displaying the title most of the time) from your theme's to push the shape into the desired zone. See this blogpost explaining exactly this.
May 2, 2013 at 2:39 PM
Tx. I have added <Place Parts_Title="/BeforeMain:1"/> into the Placement file but nothing has happened. Does this need to be within Match tags or anything? Ideally I would like to say Add this on all pages except home if poss to the beforemain zone.

Thank you.
May 2, 2013 at 2:52 PM
This should work alone. Do you experience this not working with a vanilla Orchard instance using the default theme too?
May 2, 2013 at 2:59 PM

Yes. Will keep trying! Thanks

May 2, 2013 at 6:00 PM
Edited May 4, 2013 at 6:35 PM
May 7, 2013 at 9:27 AM
Hi Adrian,

do you have your reply from Thursday? I glanced it but did not have a chance to try it before now but it has been edited to be empty?!

May 7, 2013 at 3:56 PM
I removed it because it was a bad answer after I looked back. Piedone is correct in saying that it should work. What does your file look like? Is there a lot in it? I tried this in an instance of Orchard 1.x that I used to play with and it worked for me. Here is what my file looks like:
    <Place Parts_Title="/BeforeMain:1"/>
    <Match ContentType="Person">
        <Match DisplayType="Summary">
            <Place Fields_MediaPicker="Content:before"/>
        <Match DisplayType="Detail">
            <Place Fields_MediaPicker-Image="/AsideSecond:1"
            <Place Fields_Link-HomePage="/AsideSecond:6"/>
May 9, 2013 at 4:05 PM

Hi Adrian

Thanks for your reply. I tried clearing out what was in my placement file and starting from scratch. It now works! This is what I have done so far


<!-- Position fields on Property summary page -->

<Match DisplayType="Summary">

<Place Fields_Common_Text-Price="Header:1"/>

<Place Fields_MediaPicker-MainImage="Content:1"/>

<Place Fields_Common_Text-Name="Content:1.1"/>

<Place Fields_Common_Text-Subtitle="Content:2"/>

<Place Fields_Enumeration-PropertyType="Content:3"/>

<Place Fields_Common_Text-Location="Content:4"/>

<Place Fields_Common_Text-Shortdescription="Content:5"/>

<Place Fields_Common_Text-Size="Content:6"/>

<Place Parts_Common_Body_Summary="Content:7"/>

<Place Parts_Tags_ShowTags="Content:8"/>



Thanks a lot


May 13, 2013 at 4:01 PM
Hi I have my page title working on every page by adding this to my placement file <Place Parts_Title="/BeforeMain:1"/>

however, I want the page title to appear in a html widget in a layer called 'Allexcepthome' - is there a way to do this please?

May 13, 2013 at 4:35 PM
kirstybash wrote:
however, I want the page title to appear in a html widget in a layer called 'Allexcepthome' - is there a way to do this please?
Putting it into a widget with layer rules sounds like fun. Ive only targeted zones so far. How complex is this rule? You could write a simple check on the theme zone to see if its the root directory and whether or not to render out that zone.
May 14, 2013 at 10:00 AM

Thanks Matt for you reply.

After trying this out for a while I ended up not using layers but I wrote the following in the placement file:-

<!-- Add the page name to the site except on the home page -->

<Place Parts_Title="/BeforeMain:1"/>

<Match Path="~/">

<Place Parts_Title="-" />