Using Title for Search Engines as Link Text
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
>
Hi,
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();
This is a post on how to get the title for search engines, not how to search by it. :(
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;
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;