Hide title in Orchard header but not in browser tab (<html><head><title>) for one page

Topics: Customizing Orchard
Apr 2, 2014 at 8:53 AM
Hello.

I have created a new Page in my Orchard and I have hidden the title using placement info.
<Placement>
<Match Path="~/todo-en-uno">
  <Match ContentType="Page">
    <Place Parts_Title="-"/>
    <Place Parts_Tags_ShowTags="-"/>
    <Place Parts_Common_Metadata="-"/>
  </Match>
</Match>
</Placement>
I want to hide the title only in this page so i have added "Match Path" in placement.info

It works properly but the problem is that the title also dissapears from title tag in html head.

Image

I would like to show the page title in ths browser tab.
Dou you know how to solve it?

Thank you and regards.
Apr 2, 2014 at 9:07 AM
Edited Apr 2, 2014 at 9:22 AM
Hi,

Don't hide the shape instead override it. Create a new shape in your themes folder "Parts.Title.cshtml"

Like this
@{
    Layout.Title = Model.Title;
}

<h1>@Model.Title</h1>
In order to hide the Title on any page just remove the h1 tag
@{
    Layout.Title = Model.Title;
}
If you want to remove the h1 title for just one page for example like the about then create a new shape in your themes folder

with a name like this "Parts.Title-url-about.cshtml" or you can even use the shape tracing and the url alternate module to do that.

In your case the shape name will be like this "Parts.Title-url-todo-en-uno.cshtml"

Best

Abhishek Luv
Apr 2, 2014 at 9:11 AM
Thank you for your quick answer!

I only want to hide the title in the content in that specific page. In the rest of the pages I want to continue showing the title.
Could you explain me how to do it only for one specific page?

Regards.
Apr 2, 2014 at 9:12 AM
I have updated my answer.
Apr 2, 2014 at 10:10 AM
Edited Apr 2, 2014 at 10:13 AM
Hello.

I have needed to do some additional actions:
  • Install Designer Tools -> Go to Orchard Module Gallery and search for "Designer Tools". Install it (enable Shape Tracing and Url Alternates)
  • Go to Theme Views folder (/Themes/YOUR_THEM/Views) and (if not exists) create folder "Parts" (/Themes/YOUR_THEM/Views/Parts)
  • Create the view "Title-url-[YOUR_PAGE_URL].cshtml" (Title-url-todo-en-uno.cshtml) in Parts folder with the following code:
@{
    Layout.Title = Model.Title;
}
  • If you had hidden title in placement.info, remove the line "<Place Parts_Title="-"/>" from placement.info
Hope it helps.

Regards.
Apr 2, 2014 at 10:29 AM
luissagasta wrote:
Hello.

I have needed to do some additional actions:
  • Install Designer Tools -> Go to Orchard Module Gallery and search for "Designer Tools". Install it (enable Shape Tracing and Url Alternates)
  • Go to Theme Views folder (/Themes/YOUR_THEM/Views) and (if not exists) create folder "Parts" (/Themes/YOUR_THEM/Views/Parts)
  • Create the view "Title-url-[YOUR_PAGE_URL].cshtml" (Title-url-todo-en-uno.cshtml) in Parts folder with the following code:
@{
    Layout.Title = Model.Title;
}
  • If you had hidden title in placement.info, remove the line "<Place Parts_Title="-"/>" from placement.info
Hope it helps.

Regards.
Cool
Apr 2, 2014 at 11:01 AM
Now, before my custom title appears the project title: "PROJECT TITLE - Page title" (RiojaDotNet - Todo en uno)
Do you how to remove project from title?

Regards.
Apr 2, 2014 at 11:20 AM
RiojaDotNet is your site name coming from SiteSettings.

You want to remove that also?
Apr 2, 2014 at 11:29 AM
Yes, in that specific page only shoud appear my custom title. Is it possible?

Thank you and regards.
Jan 27, 2015 at 8:15 AM
Hello.

I have a new question.
I would like to remove the title in all my pages located in the path "events": ~/events/*
http://mysite.com/events/numberone
http://mysite.com/events/numberthree
http://mysite.com/events/numberfour

Dou you know how to solve it?

Thank you and regards.