Copied to clipboard

Flag this post as spam?

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


  • Dany Wu 81 posts 114 karma points
    Jul 31, 2009 @ 01:00
    Dany Wu
    0

    Combining static text and page field in <title>

    Hi folks, this is something I used successfully in v3 but can't seem to get to work in v4. I am using v4.0.2.1 and have inserted the following in my <head runat="server"> section:

    <title><umbraco:Item field="pageName" runat="server"></umbraco:Item> - Savitar Bernese Mountain Dogs - New Zealand</title>

    Unfortunately it seems to only display the pageName but completely ignored the static text after it. Has anyone else encountered this? I've probably missed something simple and fundamental here but can't think of what that may be!

    Any suggestions would be greatly appreciated.

    Thanks,
    Dany.

  • Simon Justesen 436 posts 203 karma points
    Jul 31, 2009 @ 01:37
    Simon Justesen
    100

    If you remove runat="server" from your <head>-tag it should be working correctly

  • Simon Justesen 436 posts 203 karma points
    Jul 31, 2009 @ 01:44
    Simon Justesen
    0

    If you need to have runat="server" at the <head>-tag, I think you need to put everything inside fx. a xslt-macro as a workaround :)

  • Dany Wu 81 posts 114 karma points
    Jul 31, 2009 @ 01:55
    Dany Wu
    0

    Ah! Perfect! That did it thanks :o) At the moment I don't need runat="server" in the <head> - will wrap it in a macro when it becomes necessary. Thanks again...

  • Rick Mather 42 posts 124 karma points
    Jul 31, 2009 @ 11:54
    Rick Mather
    1

    Easest way to do it inside a <head runat="server"> would be:

    <umbraco:Item Field="pageName" insertTextAfter=" - Savitar Bernese Mountain Dogs - New Zealand" runat="server" />

  • Dany Wu 81 posts 114 karma points
    Aug 01, 2009 @ 02:52
    Dany Wu
    0

    Thanks Rick, that's good too but I've wrapped it in a macro to make it more configurable for SEO

Please Sign in or register to post replies

Write your reply to:

Draft