Forum Moderators: Robert Charlton & goodroi
I'm working on a complex ecommerce site.
Due to development constraints and complex caching strategies, our H1 tags have to be served in the <head> element.
The developers offered to put them into the source code as hidden divs and then I can move them to the main section using JS.
I'm afraid Google will think this is Black Hat and I'm not sure if I should do it.
Has anyone any advice?
Thanks
Donal
# Line 34, Column 3: document type does not allow element "h1" here; assuming missing "object" start-tag.
# Error Line 35, Column 6: end tag for "object" omitted, but OMITTAG NO was specified.
</head>
You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">" Do they still issue "Pink Slips"? If not, got some pink paper? Print their notice of termination on it just for the heck of it. ;)
Top Nav is cached on a page level. Left Nav and footer is cached site wide. Putting the information into these will mean the H1 tags won’t be different per page. We’ve 100s of centre templates so to put the logic that creates the tags into these will be extremely difficult and the cost becomes exponential.
Developers have confirmed that the header file includes the opening body tag and our header image. They’ve offered to put the h1 tag in the body and move it to a placeholder when the page loads. It would probably be hidden so the user doesn’t realise we’re moving text. I presume this is equally bad?
Thanks
Donal
At worst, your developers should be advising on how they can fix the inherent problems with your templating/caching system.
Aside from this, why are you going to all this trouble to add a heading? The element in itself is not going to give you much benefit, unless it's part of a well-structured document. It sounds like you're unlikely to have a well-structured document.
Putting the heading within the <body> section is valid, but if it's in the document, why mess around with javascript and placeholders? You could probably put it in place easily enough with pure CSS.
It sounds to me like your developers are working on programming solutions to problems you don't have. They should be working on the wider problems you have with the technology behind your site.
Left Nav and footer is cached site wide. Putting the information into these will mean the H1 tags won’t be different per page.
Obviously we don't know how your site works exactly, but I know many sites that have global templates with things like titles and headings in them. The titles and heading are variables which change depending on which page is being viewed. This is an essential part of most templating systems.
As Receptional Andy pointed out, IF this is the case, then it would seem that you should be able to add the H1 directly after the opening body tag then use CSS to position it as you require for each page.
Of course, as other's have mentioned, it sounds as if the backend of the site is somewhat of a mess and you would likely benefit form a redesign (and possibly better developers).
You have found yourself waist deep in spaghetti code my friend. When things get like this there comes a point where it is $300 per sq foot to renovate and $100 per sq foot to build brand new.
You should evaluate if you have passed that breaking point.
Sorry because I know this is hardly a solution to your problem but things will only get worse as more code is "hacked" on to make things work as they should have been working the whole time.
Good Luck
[edited by: Demaestro at 9:11 pm (utc) on Jan. 13, 2009]
Finding such a bad developers is not imposible, but pretty difficult (if you do, fire them; if you can't fire them, then your boss knows nothing about the business, fire yourself from there if you can). So probably the second is the case, and they have a communication problem.
irldonalb: tell them to do it in a test server, then check, validate, or do whatever you need to do.
An optimized kluge is like a black hole for programming effort: it sucks in minds, souls, and money, and emits lethal radiation.
But you know that, by experience, _now_.