Try Now
More in this section

Forums / Designing & Styling / Page Title control

Page Title control

2 posts, 0 answered
  1. Samir Vaidya
    Samir Vaidya avatar
    261 posts
    05 Feb 2005
    24 Jul 2011
    Link to this post
    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?

  2. Steve
    Steve avatar
    3037 posts
    03 Dec 2008
    24 Jul 2011
    Link to this post
    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
2 posts, 0 answered