Title for search engines - simple question

Posted by Community Admin on 03-Aug-2018 07:31

Title for search engines - simple question

All Replies

Posted by Community Admin on 15-Dec-2011 00:00

Hi,

I have a simple question.

I would like to create a suffix for all of my pages. I intend to put this code in my master page. All I want to do is get the value of the "Title for search engines" from the code behind of the current page and append " - XYZ Company" to the title of every page, instead of manually doing it for every page.

How do I get the property "Title for search engines" using the fluent API?

Thanks

Posted by Community Admin on 15-Dec-2011 00:00

Hello Raul,

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

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


All the best,
Victor Velev
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

Posted by Community Admin on 15-Dec-2011 00:00

Raul,

This is a really simply way of doing it. You just need to put this in your master page:

<title><%=Page.Title %> - XYZ Company</title>

Posted by Community Admin on 11-Sep-2014 00:00

Hey Tim,

 That gets the pages title, but the question was for the 'title for search engines'. I'm looking around for it now but if someone has that answer before I post it, would be appreciated. 

Posted by Community Admin on 11-Sep-2014 00:00

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;
           


Posted by Community Admin on 16-Sep-2014 00:00

Hello Richard,

Here is a simpler 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
 

This thread is closed