Copied to clipboard

Flag this post as spam?

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


  • Bex 444 posts 555 karma points
    Aug 31, 2010 @ 16:25
    Bex
    0

    head with runat server and page field - can't find solution on here?

    Hi!

    Our website is using a pagefield to determine the css file that a page uses, by using the following line:

      <link href="/css/<umbraco:Item field='theme' useIfEmpty='Choose' textIfEmpty='standard' recursive='true' runat='server'></umbraco:Item>.css"
                rel="stylesheet" type="text/css" />
    

    This was working all well and good until I had to add a run at server to the head because I added a ajax calendar extender to a page, now as many people have pointed out any macro or pagefield put in the head when runat server is on there it renders as plain text.

    As I said lots of people have this problem but I cannot determine the solution from the posts.. 
    Is there an available solution out there that I am missing or is it just something I can't do?

    Bex

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Aug 31, 2010 @ 16:37
    Ismail Mayat
    0

    Bex,

    Think there is issue logged on codeplex as it looks like something needs to change in the core. I ended up using jquery ui calendar instead of ajax one.

    Regards

    Ismail

  • Bex 444 posts 555 karma points
    Aug 31, 2010 @ 16:47
    Bex
    0

    I found this post:
    http://our.umbraco.org/forum/templating/templates-and-document-types/3278-Combining-static-text-and-page-field-in-title

    Which appears to be having the same problem and it says

    "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 :)" (the post by Simon Justesen)

    But I have no clue what this means? Unless this isn't the same problem?
    It's going to be rather annoying if I have to change the way it works!

     

     

  • Bex 444 posts 555 karma points
    Aug 31, 2010 @ 17:12
    Bex
    0

    Well I have found a work around for my particular problem.. but by no means a fix..
    I have stuck the stylesheet line in the body and it still works.. not a good way of doing it.. but works.

  • Richard 146 posts 168 karma points
    Sep 01, 2010 @ 17:39
    Richard
    0

    To overcome a similar problem, I was outputing the meta description field, I created a macro that output the complete line, in your case

    <link ... type="text/css" />

    And then called the macro in the master template. This was with runat="server" on the head tag.

  • Bex 444 posts 555 karma points
    Sep 02, 2010 @ 09:48
    Bex
    0

    I tried puttinga macro in the head of the master page that had runat server but it stil rendered as plain text.
    I have not tried in the master teplate though.

  • Richard 146 posts 168 karma points
    Sep 02, 2010 @ 10:03
    Richard
    0

    Our Master template looks like:

    <head runat="server">
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

    <umbraco:Macro Alias='CleanMetaDesc' meta='description' runat='server' />

     

Please Sign in or register to post replies

Write your reply to:

Draft