Adding a counter to exported web pages

Our genealogy database program.

Moderator: Nick Hunter

Post Reply
j.loh
Posts: 4
Joined: Sat Jun 13, 2009 3:12 pm
Contact:

Adding a counter to exported web pages

Post by j.loh » Sun Feb 14, 2010 8:26 pm

Hi,

I would like to add a counter to the web pages exported by K+K. I decided to use statcounter.com, they can generate a XHTML snippet that I have to add to my web pages, but as AFAIK K+K doesn't allow me to add it to my pages in a W3C compliant way.

The only places I found are the "Global header" and "Global footer" fields in the "Export WWW files" dialog. The result is that the code is wrapped inside <div><p> tags (similar for the footer):

Code: Select all

<div class="global_head">
<p><!-- the counter code --></p>
</div>
Inside this tags, the code doesn't validate, in particular the <noscript> tag isn't allowed in this context.

Is there another way to include the code to the pages?

Regards,
Jürgen

j.loh
Posts: 4
Joined: Sat Jun 13, 2009 3:12 pm
Contact:

Re: Adding a counter to exported web pages

Post by j.loh » Mon Feb 15, 2010 1:36 am

Hi,

I found a very simple solution myself. I added a </p> before and a <p> after the counter code:

Code: Select all

</p><!-- the counter code --><p>
K+K simply copies this to the web pages. The result is that the counter code is outside the <p> tags:

Code: Select all

<div class="global_head">
<p></p><!-- the counter code --><p></p>
</div>
The empty <p></p> paragraphs are ignored by the browser - perfect! :D

Regards,
Jürgen

Post Reply