I can see a disadvantage in having the runat server on the head-tag if we are using a macro to generate the different meta tags including the title-tag. I always use a XSLT macro to create the meta-tags and the title tag in my head, so that I can have some different fallback, and the admins can have some different opportunities. But the problem is, that if I have the runat server on my head-tag and there is no title-tag in the template, then the runat server will create an empty title-tag like this:
<title></title>
When my page is rendered then, I'm suddently having two title-tags in my head-tag, and one of them will even be empty. And we all know that two title-tags in the head-tag will not work at all.
I also use a "header" macro to fill out metatags etc exactly as Kim does. And the reason i want to avoid the runat="server" attribute on the <head> tag is the same. I dont want two <title> tags in my header.
So if there is a way to supress the empty title tag i would not mind having the runat="server" attribute on my <head> tag. Not sure if that is possible though ?
Could you perhaps avoid using the extension by using a content placeholder i the head section, which you then use in the template where you put the macro that's in need of the specific JavaScript?
That's great. I'm actually a bit stunned that I have never thought of this option myself before. But it's definately something I'll play around with. I'm thinking it should be possible to use in conjunction with the clientdependency framework somehow.
So authors have to put their meta in manually. Haven't looked into generating meta tags with a macro before. Sounds handy! Will definitely have a read up :)
Actually, the way I described is quite nifty, as the users always have the full access to how the meta tags will look - If they want to :)
If the users are lazy and doesn't take the time to write some unique titles, descriptions etc., the macro will generate some fairly unique and descriptive content to be put in the meta tags.
So if the users want to, they have the full access to how the content of the tags looks like, and even if they don't take the time, the titles etc. will still be quite good and unique for the search engines :)
RegisterJavaScriptFile without runat="server" in <head> tag
Hi,
I was wondering if it is possible to use umbraco.library:RegisterJavaScriptFile() without having a runat="server" ind the <head> tag ?
Any suggestions will be much appreciated :-)
/Thor
Hi Thor,
Unfortunately not: see the wiki page http://our.umbraco.org/wiki/reference/umbracolibrary/registerjavascriptfile
Cheers,
Michael.
Hi Thor,
Why are you so keen to avoid that runat server tag?! Perhaps there might be a way round what it's breaking?
Many Thanks,
Tom
Hi Tom
I can see a disadvantage in having the runat server on the head-tag if we are using a macro to generate the different meta tags including the title-tag. I always use a XSLT macro to create the meta-tags and the title tag in my head, so that I can have some different fallback, and the admins can have some different opportunities. But the problem is, that if I have the runat server on my head-tag and there is no title-tag in the template, then the runat server will create an empty title-tag like this:
When my page is rendered then, I'm suddently having two title-tags in my head-tag, and one of them will even be empty. And we all know that two title-tags in the head-tag will not work at all.
Just my five cents :)
/Kim A
Hi Tom,
I also use a "header" macro to fill out metatags etc exactly as Kim does.
And the reason i want to avoid the runat="server" attribute on the <head> tag is the same. I dont want two <title> tags in my header.
So if there is a way to supress the empty title tag i would not mind having the runat="server" attribute on my <head> tag.
Not sure if that is possible though ?
Any ideas will be much appreciated :-)
Hi Thor
Could you perhaps avoid using the extension by using a content placeholder i the head section, which you then use in the template where you put the macro that's in need of the specific JavaScript?
Like Tentonipete is demonstrating in his post here: http://our.umbraco.org/forum/templating/templates-and-document-types/16193-css-for-templates-%28not-master%29
/Jan
Hi Jan,
That actually sounds like a possible solution to the problem, thanks for your input :-)
/Thor
Hi Thor
That's great. I'm actually a bit stunned that I have never thought of this option myself before. But it's definately something I'll play around with. I'm thinking it should be possible to use in conjunction with the clientdependency framework somehow.
/Jan
Hi Kim,
Ahhhh! I see where you're coming from, I only ever tend to do things like;
So authors have to put their meta in manually. Haven't looked into generating meta tags with a macro before. Sounds handy! Will definitely have a read up :)
Many Thanks,
Tom
Hi Tom
Actually, the way I described is quite nifty, as the users always have the full access to how the meta tags will look - If they want to :)
If the users are lazy and doesn't take the time to write some unique titles, descriptions etc., the macro will generate some fairly unique and descriptive content to be put in the meta tags.
So if the users want to, they have the full access to how the content of the tags looks like, and even if they don't take the time, the titles etc. will still be quite good and unique for the search engines :)
/Kim A
is working on a reply...