Page Title control

Posted by Community Admin on 05-Aug-2018 01:42

Page Title control

All Replies

Posted by Community Admin on 24-Jul-2011 00:00

I would like to add a Page Title/Page Description control to my Page Template or to my individual content pages.

Is there a built-in Sitefinity control in the toolbox which will allow me to display the Page's configured Title/Name on my content pages without having to manually type it into a Content Block for each and every Content Page?

Posted by Community Admin on 24-Jul-2011 00:00

No built in one (yet anyway)

But it's pretty easy with a custom control...here's some code I use (stripped from the larger control)

PageSiteNode node = SiteMapBase.GetActualCurrentNode();
pageTitleLabel.Text = String.Format("<span class='titletext'>0</span>",
                                    (!String.IsNullOrEmpty(this.Text) ? this.Text : (node == null) ? "Page Title" : node.Title));

So I also have a public "Text" property that allows me to override the default title if I want

This thread is closed