When i use this in Umbraco 4.0.3 it removes the Sitename |, and uses only the pagename. When i remove the umbraco:Item field... from <title> Sitename works. I have tested with removing |, put the Sitename atfter the umbraco:Item field... with the same result.
Hmm, not sure why this is happing... could it be a solution to use the insertBefore option when inserting the umbraco item from the insert dialog? May need to html escape the pipe symbol.
I also found the reason why this was happening, a usercontrol required in som reason <head runat="server">, when i removed runat="server" it also work.
I always use an asp literal to include the text i want to add.
ps. from an SEO point of view, you want to use a suffix instead of a prefix on all innerpages, this way the actual topic of the page is what people start to read on a search result page in google, instead of your company name.
Problem with text or pageName in <title>
In my master-template i have used this in earlier versions of Umbraco to show a title like «Sitename | Pagename».
When i use this in Umbraco 4.0.3 it removes the Sitename |, and uses only the pagename. When i remove the umbraco:Item field... from <title> Sitename works. I have tested with removing |, put the Sitename atfter the umbraco:Item field... with the same result.
The page source code shows the title like this:
In earlier versions of Umbraco i get this result:
Hmm, not sure why this is happing... could it be a solution to use the insertBefore option when inserting the umbraco item from the insert dialog? May need to html escape the pipe symbol.
Hope this helps.
Regards,
/Dirk
Thanks it works!
I also found the reason why this was happening, a usercontrol required in som reason <head runat="server">, when i removed runat="server" it also work.
I had the same problem, with two title tags when the the head had a runat="server" and using something like
<title><umbraco:Item field="pageTitle" htmlEncode="true" runat="server"></umbraco:Item></title> in the head section.
To fix this you can do something like <title><asp:ContentPlaceHolder ID="titleContent" runat="server" /></title> and the fill the placeholder.
I found this solution at http://haacked.com/archive/2009/04/03/tipjar-title-tags-and-master-pages.aspx
I always use an asp literal to include the text i want to add.
ps. from an SEO point of view, you want to use a suffix instead of a prefix on all innerpages, this way the actual topic of the page is what people start to read on a search result page in google, instead of your company name.
So this:
is better than this:
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.