After moving site body ID is messing.

Permalink
Hi, after i moved my site from one server to another my body ID is messing.

Enyone ever tried this error? It's seems like no matter what i put in my body tag id / class when is render it just get removed.

My develop url :
http://projekter.resonate.dk/ubiquitech/...

live url:
http://u12zvka.nixweb06.dandomain.dk/...

 
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
Have you tries clearing your cache?
Resonate replied on at Permalink Reply
Jep, does not work :(
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
Do you have a live URL to look at?
Resonate replied on at Permalink Reply
Yes.
My develop url :
http://projekter.resonate.dk/ubiquitech/...

live url:
http://u12zvka.nixweb06.dandomain.dk/...

If you look at the soure you can se the <body id="swosh"> is messing on the live url.

I have just made a temporary fix for it becuse the client is making the content.

<script>
   $(function() {
     $("body").attr("id","swosh");
   });
</script>
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
Well try to put that script in footer, not in header. And check it again.

Hope it solve this.
Resonate replied on at Permalink Reply
The script works fine, but i will rather not have the script and just have the id on the body tage in the header..
It's just weird that it's get removed on one server and not on the other...
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
Maybe this is not linked with this issue, but while looking into source code, I can see below:
<a href="/index.php/en/home/"><img border="0" class="ccm-image-block" alt="" src="/files/1513/9237/9647/ubiquitech.png" width="200" height="60" /></a>  
        </a>


So there is additional </a>

Rony
Resonate replied on at Permalink Reply
Is there not some who know about this problem?
drbiskit replied on at Permalink Reply
drbiskit
How is the swosh id supposed to be generated? Is it hardcoded, added by script, dynamic dependant on page, etc?

Currently, when I view source on the live site, I see the opening body tag appearing twice, both times with the swosh id - that will need sorting out.
keeasti replied on at Permalink Reply
keeasti
I actually see it like this:

<body>
<body id="swosh">


But the question is valid ... where are you putting the ID?

I would usually hardcode it into the template. Sometimes, I put in this snippet into the template (mostly in header.php) to give each page a unique ID (using the page name) and a class (using the page type):

<body id="<?php echo $c->getCollectionHandle(); ?>" class="<?php echo $c->getCollectionTypeName(); ?>">
Resonate replied on at Permalink Reply
I hardcode it in to the header.php

It's so weird ..
Both body looks like this in the header.php
<body id="swosh"> 
<body id="swosh">

The first body the ID is in some how removed..
And then they look like this in view source
<body > 
<body id="swosh">


I've tried different things and had to see what would happen if there was another one.. I know it's very wrong
drbiskit replied on at Permalink Reply
drbiskit
There are some other markup errors that I would try cleaning up...

In source code you have things like this:
<span class="fa-stack fa-lg"">

ie - with 2 closing quotation marks. This is happening in several places. I would sort this out first, see if that helps.
mhawke replied on at Permalink Reply
mhawke
So you are hard-coding 2 < body > tags both with the same ID? Why?

I think you are leaving a lot to chance because the browser is going to try to fix this broken markup.
Resonate replied on at Permalink Reply
Yes, it was only to see if the second one got removed as well..
keeasti replied on at Permalink Reply
keeasti
Please attach your header.php file to take a look
Maybe also footer.php and default.php
Resonate replied on at Permalink Reply
Hmm can't attach the files, get this.
an invalid extension. ( tryed .php .html .rar)
drbiskit replied on at Permalink Reply
drbiskit
change the file extensions to .txt
Resonate replied on at Permalink Reply 3 Attachments
Of course .. It just not my day to day .. Thanks for helping out :)

Here is the files.

The wired thing is, it works on my develop server whit out the script.

http://projekter.resonate.dk/ubiquitech/...
drbiskit replied on at Permalink Reply
drbiskit
Looks like you've fixed this now? What was it?
keeasti replied on at Permalink Reply
keeasti
Doesn't look fixed to me...
Resonate replied on at Permalink Reply
Unfortunately not, just use this until I find a solution ..

<script>
   $(function() {
     $("body").attr("id","swosh");
   });
</script>


I do not understand it, have never experienced this problem before
drbiskit replied on at Permalink Reply
drbiskit
Ah ok - I can only see one
<body id="swosh">

when I view source, so i figured you may have fixed it...

Have you tried disabling your scripts one by one to check whether any of them are removing the id attribute?

Also - it looks like the markup errors i mentioned previously are still happening. It's always worth tidying up markup errors as a first port of call because they can cause weird things to happen elsewhere, apart from obviously not validating.
Resonate replied on at Permalink Reply 1 Attachment
It teases like crazy .. I've have correct the things you wrote.
I also just copy and paste the entire source code into an HTML document to see if there was anything. And then I get this error

HTMLHint Errors: Special characters must be escaped : [ < ].  <body>


I have attached a picture
mhawke replied on at Permalink Reply
mhawke
What text editor are you using to edit the php files? Perhaps your editor has injected an odd character. You might just have to re-type the body tag (but I suspect you have done that many times in the course of your experimentation.)
Resonate replied on at Permalink Reply
Adobe Edge code

I've tried several different programs and rewritten the tag countless times..

:(
mhawke replied on at Permalink Reply
mhawke
Have you tried removing all the white space between the < /head > and the < body > tags so it looks like this:

< /head>< body >