Try Now
More in this section

Forums / Designing with Sitefinity / Automatic Titling

Automatic Titling

2 posts, 0 answered
  1. Joshua Taylor
    Joshua Taylor avatar
    7 posts
    23 Dec 2009
    09 Jan 2010
    Link to this post
    Sitefinity appears to suggest that I title pages in the following format:

    Project Name - Top Level Parent - Previous Page's Menu Label
    (It may be that Sitefinity is just trying to emulate my titling methodology)

    Is there a way to get it to automatically title pages in this format:

    Project Name - Top Level Parent - Current Page's Menu Label

    This would drastically reduce the time for content build out, for me anyway.  Even if this information was simply the default value for the title field, that would be great.

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    19 Oct 2016
    10 Jan 2010
    Link to this post
    Hi Joshua Taylor,

    There are two options if you want to do this during the page creation process.

    1. Modifying Sitefinity/Admin/ControlTemplates/Pages/PagePropertiesInsert.ascx

    - Create a Link button in HeadContent area

    <ol class="setIn clearfix">
            <h5><asp:Label ID="Label4" AssociatedControlID="Title" runat="server"><asp:Literal runat="server" Text="<%$Resources:Title %>"></asp:Literal></asp:Label> <em id="TitleLabel" runat="server"></em> <cc1:LabelToolTip id="labelHelpBox6" runat="server" HelpBoxCssClass="HelpBox" ToolTipTitle="<%$Resources:PageTitle %>" ToolTipText="<%$Resources:PageTitleDescription %>" AlternateText="<%$Resources:AboutTitles %>"></cc1:LabelToolTip></h5>
            <asp:TextBox ID="Title" runat="server" MaxLength="125"></asp:TextBox><asp:LinkButton Text="postback" runat="server"  ID="copydata" ></asp:LinkButton>

    - Add the following logic on Click event

    void copydata_Click(object sender, EventArgs e)
             this.Title.Text = Telerik.Cms.Web.UrlHelper.GetProjectName() + PageName.Text + MenuLabel.Text;

    Note that you have to click the button which will cause a postback and the Title TextBox.Text will be set. You can also use update panel.

    2. Override the "SaveButton" click logic and set all properties using a custom code. You can take a look at pages API

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered