I created a website http://pobierzprogram.com and it fails validations with w3c because there are two overlaping title elements when page renders. I use some templates and double checked them and they seem to be OK.
Where is the second title element just above </head> coming from I wonder?
I use two xslt files, one for navigation and one for getting links to the content but both of them are located in body section.
On my template I have got google analitics code just before </head> tag and when the page renders in source code I can see:
google analitics code
<title></title>
</head>
Where is the title tag coming from I haven't got a clue.
In my templates I do have contentplaceholders for head section and when I create pages I put there what I want and it renders correctly (the first "good" title element is above analitics code). I wonder if umbraco puts another title element somehow and if so how I can disable it...
I think it is not from the child page because when I was making data types I added property to control titles of the pages and they work OK, In other words when creating a page I can choose the title I like and you can see it on the browser. I use special ContentPlaceHolder to pull these titles from data types. Then I close down this ContentPlaceHolder, and there is google analitics code and the end of head, </head>
Between these two elements (google and </head>) out of the blue there is another title element when page renders. Please have a look at the code from my main template and child template:
The extra title tag are for sure being created because of your runat="server" that is set on the <head>-tag. the runat="server" will create the empty <title>-tag because there is no one inserted in your master template. Even though you insert one on the child template, the runat="server" will still insert an extra one.
Either you must remove the runat="server" or you need to move the <title><umbraco:Item field="title"....></umbraco:Item></title> from the child template to the main template.
The first time I ran into this problem was when I wanted to use the umbraco.library:RegisterJavaScriptFile XSLT-extension in a project. This extension unfortunately needs the runat="server" on the <head>-tag. But since I'm creating all of the META-data (including the title-tag) in a XSLT file, I also got the extra empty title-tag.
two title elements...
hello guys
I created a website http://pobierzprogram.com and it fails validations with w3c because there are two overlaping title elements when page renders. I use some templates and double checked them and they seem to be OK.
Where is the second title element just above </head> coming from I wonder?
thanks in advance.
Hi,
I'm not sure there's a way to tell from your site.
Did you check your xslt files?
Rich
thanks a lot Rich for prompt reply
I use two xslt files, one for navigation and one for getting links to the content but both of them are located in body section.
On my template I have got google analitics code just before </head> tag and when the page renders in source code I can see:
google analitics code
<title></title>
</head>
Where is the title tag coming from I haven't got a clue.
In my templates I do have contentplaceholders for head section and when I create pages I put there what I want and it renders correctly (the first "good" title element is above analitics code). I wonder if umbraco puts another title element somehow and if so how I can disable it...
kind regards,
Hi,
Umbraco doesn't add any code.
Does the problem exist on all pages, ave you searched your .master files for <title> ?
Seems like it could be added from a child page.
Rich
Have you set a runat="server" on your <head>-tag? This can sometimes insert an extra title-tag in some cases.
/Kim A
Hello again Rich,
I think it is not from the child page because when I was making data types I added property to control titles of the pages and they work OK, In other words when creating a page I can choose the title I like and you can see it on the browser. I use special ContentPlaceHolder to pull these titles from data types. Then I close down this ContentPlaceHolder, and there is google analitics code and the end of head, </head>
Between these two elements (google and </head>) out of the blue there is another title element when page renders. Please have a look at the code from my main template and child template:
The extra title tag are for sure being created because of your runat="server" that is set on the <head>-tag. the runat="server" will create the empty <title>-tag because there is no one inserted in your master template. Even though you insert one on the child template, the runat="server" will still insert an extra one.
Either you must remove the runat="server" or you need to move the <title><umbraco:Item field="title"....></umbraco:Item></title> from the child template to the main template.
/Kim A
You were right Kim, as soon as I removed runat it disappeared. Thanks a lot.
Special thanks also for Rich for being so patient. All the best.
Glad you got it sorted, nice spot Kim! h5yr
Great!
The first time I ran into this problem was when I wanted to use the umbraco.library:RegisterJavaScriptFile XSLT-extension in a project. This extension unfortunately needs the runat="server" on the <head>-tag. But since I'm creating all of the META-data (including the title-tag) in a XSLT file, I also got the extra empty title-tag.
Well, anyway, I'm glad you got it working :)
/Kim A
is working on a reply...