Copied to clipboard

Flag this post as spam?

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


  • Anthony Candaele 1197 posts 2049 karma points
    Apr 08, 2011 @ 22:02
    Anthony Candaele
    0

    no spaces in title tag

    Hi,

    I have this weird problem. For a package (Language Selector) to work properly, I need to add the runat=server attribute in the head-tag

    But when I do that, the spaces and hyphen between the dynamic values are gone. This markup:

    <title><umbraco:Item field="siteName" recursive="true" runat="server" /> - <umbraco:Item field="pageTitle" runat="server" recursive="true" /></title>

    renders like this:

    siteNamepageTitle (e.g FlexisleHomepage)

    while it should be siteName - pageTitle (e.g Flexisle - Homepage)

    If I remove the runat=server attribute from the head-tag the <title> tag renders normally: siteName - pageName

    Does anyone has a clue what's going on?

    Thanks for your help,

    Anthony

  • Daniel Bardi 927 posts 2562 karma points
    Apr 08, 2011 @ 23:24
    Daniel Bardi
    1

    Create a HeadTitle macro... it will also clean up your template.

    You could also do this:

    <title><umbraco:Item field="siteName" insertTextAfter=" - " recursive="true" runat="server" /><umbraco:Item field="pageTitle" runat="server" recursive="true" /></title>
  • Anthony Candaele 1197 posts 2049 karma points
    Apr 09, 2011 @ 08:15
    Anthony Candaele
    0

    Hi Daniel,

    Thanks a lot, I inserted the insertTextAfter=" - " attribute and this solved the problem:

    www.flexisle.com

    greetings,

    Anthony

  • Daniel Bardi 927 posts 2562 karma points
    Apr 09, 2011 @ 08:29
    Daniel Bardi
    0

    Umbraco is a beautiful (and flexable) thing... love it..

    Glad I could help.

Please Sign in or register to post replies

Write your reply to:

Draft