Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Espen 2 posts 22 karma points
    Jan 18, 2010 @ 12:35
    Espen
    0

    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».

            <title>Sitename | <umbraco:Item field="pageName" runat="server"></umbraco:Item></title>

    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:

    <title>
    pageName
    </title>

    In earlier versions of Umbraco i get this result:

    <title>Sitename | Pagename</title>
  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    Jan 18, 2010 @ 12:43
    Dirk De Grave
    0

    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

  • Espen 2 posts 22 karma points
    Jan 18, 2010 @ 12:54
    Espen
    0

    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.

  • Christian Liebe-Harkort 56 posts 104 karma points
    Feb 03, 2010 @ 10:07
    Christian Liebe-Harkort
    0

    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

     

  • Rik Helsen 670 posts 873 karma points
    Feb 03, 2010 @ 15:36
    Rik Helsen
    0

    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:

    <title>Pagename - Sitename </title>

    is better than this:

    <title>Sitename - Pagename</title>
  • 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.

Please Sign in or register to post replies