Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Hi there,

I can't figure this one out.. when I move my header to a snippet and import it using the cms:embed tag, it is preceded by a text node that throws the formatting of my page out (essentially creating a single text row before my header). I can create a work-around with JS or something, but it's clearly a bug, so I just want to fix it.

When I examine the node, it does have some content (when I paste it into notepad++), but it's mostly whitespace characters, with the exception of what looks like a tiny red dot (in chrome) and a question mark when pasted into notepad. I'm guessing it is just a spurious control character, but is this normal? I get this in other templates, too, but I need to remove it.

Any help would be appreciated :)

Thanks,

T.

FYI, I've removed/changed ALL content in the snippet, so it is the cms:embed function itself creating the node. Here's the code:

<cms:embed "header.html" />
Hi,

I have a hunch that the mystery characters are the 'UTF BOM' bytes.
Please try saving the snippet file (i.e. 'header.html') as 'utf8 without BOM' or plain 'ANSI' (most text editors have this option).

Hope this helps. Please let us know.
Thanks.
Man, that was an excellent spot! Well done :)

Yep, it worked a treat. I am using visual studio 2012 and you're right, the default encoding is UTF8 signed with a byte order mark (BOM). It doesn't let you change this globally, but I found a plug-in to allow overriding this default behaviour (so you don't have to go to 'save as > save with encoding' every time):

http://vlasovstudio.com/fix-file-encoding/

It needs a restart, but when you see it in the tools > options menu you can set a regex for different files if need be (default is HTML-only).

Thanks again, that was really bothering me :)

Toby
I am glad it helped :)
4 posts Page 1 of 1
cron