This project is read-only.

How to Render Page Title on Layout

Topics: Core, Customizing Orchard, General
Aug 7, 2012 at 12:23 AM


I am quite new to Orchard, and I've done about a weeks research without finding anything that I can understand.  Please bear with me - I am a layman.  Hopefully someone on these forums can help me out. 

I am using a modified version of TheThemeMachine.  Through help from other forums, I was able to create a sort of 'frame' that borders around my content by modifying the 'Layout.cshtml' file in my theme.  Now I can focus on creating my pages without manually inputting in the frame in HTML, as Orchard places my content inside the frame perfectly.

The top of the frame has a small section where I would like the Page Title and Date to display.  Before, when I was manually entering the HTML for the frame, I was able to control the Title and call it whatever I want, since I am coding it into the HTML.  When creating new content, the very first field asks for a Title.  I want to pull this Title and have it display in my frame. 

My problem is I can't seem to find the variable to get this Title to appear!  I've tried '@Model.Title', but this only works for my blog pages.  It does not work for pages created through the Content section of the Orchard Admin. 

I have used the Shape Tracing module to try and locate this variable.  I have tried everything that gives a value that matches a Page's Title (@Model.ContentItem.TitlePart.Title, @Model.ContentPart.Title, etc).

How do I get Orchard to generate a Page's Title, as provided on Content Pages? 

Thanks in advance,

Aug 8, 2012 at 4:10 PM

Did you try @Layout.Title?