+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Using Title for Search Engines as Link Text

Using Title for Search Engines as Link Text

6 posts, 0 answered
  1. Paul
    Paul avatar
    28 posts
    Registered:
    17 Jan 2012
    30 Jan 2012
    Link to this post
    Hi

    Is it possible to Use the "Title for Search engines" property of a page so that I can display it as the text for the page link on my Master Page. I am currently using the following code:

    <asp:Repeater id="rpChildPages" runat="server">
        <HeaderTemplate>
            <ul id="primaryNav">
        </HeaderTemplate>
        <ItemTemplate>     
            <li>
                <asp:HyperLink ID="navlink" runat="server" CssClass="nodeLink" NavigateUrl='<%#((PageNode)Container.DataItem).GetFullUrl() %>'
                    Text='<%# Eval("Title") %>'>
                </asp:HyperLink>
            </li>                       
        </ItemTemplate>
        <FooterTemplate>
            </ul>
        </FooterTemplate>
    </asp:Repeater>

    However, am not sure what the property is for the "Title for Search Engines" which I have altered to contain text for the Url. The title only displays the Page Url.

    Thanks
  2. Viktor
    Viktor avatar
    22 posts
    Registered:
    01 Nov 2011
    30 Jan 2012
    Link to this post
    Hi,

    I believe there is TitleHtml or HtmlTitle property on the page node. This is what we've been setting to create page nodes programmatically. 
  3. Grace Hallwachs
    Grace Hallwachs avatar
    144 posts
    Registered:
    03 Nov 2014
    03 Feb 2012
    Link to this post
    Hello,

    You can access the field by getting Page.Htmltitle property. Please review the code snippet which gets all pages with that particular title.

    App.WorkWith().Pages()
                   .Where(p => p.Page.HtmlTitle == "titleforsearchengines")
                   .Get();

    Please let us know if you have anymore questions or concerns.

    All the best,
    Grace Hallwachs
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  4. Richard
    Richard avatar
    103 posts
    Registered:
    04 Apr 2013
    11 Sep 2014 in reply to Grace Hallwachs
    Link to this post

    This is a post on how to get the title for search engines, not how to search by it. :(

  5. Richard
    Richard avatar
    103 posts
    Registered:
    04 Apr 2013
    11 Sep 2014 in reply to Richard
    Link to this post

    Yup. Nice'en e.z. Just like SF. Could this be simplified or optimized?

    var currentPageNode = SiteMapBase.GetActualCurrentNode();

                IQueryable<PageNode> pageNodes = App.WorkWith().Pages()
                               .Where(p => p.Id == currentPageNode.Id)
                               .Get();
                foreach (var pageNode in pageNodes)
                {
                    var t = pageNode.Page.HtmlTitle;
                }


  6. Vassil Vassilev
     Vassil Vassilev avatar
    308 posts
    Registered:
    21 Jan 2015
    16 Sep 2014
    Link to this post
    Hello Richard,

    As mentioned in this forum thread:Title for search engines - simple question, here is a shorter way to get html title of the current page:
    var CurrentPageId = SiteMapBase.GetActualCurrentNode().Id;
    var HtmlTitle = PageManager.GetManager().GetPageNode(CurrentPageId).Page.HtmlTitle;

    Hope this helps.

    Regards,

    Vassil Vassilev
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
6 posts, 0 answered