Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-03-23 17:20:11

coolhat
Member
Registered: 2006-03-11
Posts: 13

W3C Validation Error When Using Javascript And Listing on Technocratiy

My pages are not getting listed on Tecnocrati and their site says I must do a W3C validation first. But I am experiencing numerous validation errors when I put in my “blogroll me” and “phpadsnew” javascript code into TXP. I checked to make sure the language/Javascript attribute is there and it is. So I cannot understand why it is happening. Am I missing some setting in TXP?.
coolhat

Offline

#2 2006-03-24 01:32:38

NyteOwl
Member
From: Nova Scotia, Canada
Registered: 2005-09-24
Posts: 539

Re: W3C Validation Error When Using Javascript And Listing on Technocratiy

I’ll assume the site is the one in your e-mail address?

Ok there are a couple of things, and most of the subsequent errors cascade from them.

1)When you use an XHTML DOCTYPE, you need to end tags such as IMG and BR with a / before closing them such as <code><img … />, <br /></code>. You’ve left off a few closing /.

2) As for the line of javascript, you will need to escape the apersands using &amp; in order to get it to validate.

If it won’t function using <code>&amp;</code> in place of & then move it into a script declaration in the HEAD and call it from there.

Hope it helps.


Obsolescence is just a lack of imagination. / 36-bits Forever! / #include <disclaimer.h>;

Offline

#3 2006-03-24 15:49:16

coolhat
Member
Registered: 2006-03-11
Posts: 13

Re: W3C Validation Error When Using Javascript And Listing on Technocratiy

Thank you I will look into this and get back on how it goes.

Offline

#4 2006-03-24 16:30:42

coolhat
Member
Registered: 2006-03-11
Posts: 13

Re: W3C Validation Error When Using Javascript And Listing on Technocratiy

I had emailed Technorati about this issue and they got back to me saying for better indexing of the posts I should modify the permalinks I am using:
<code>Currently your Permalink for one of your Posts is:
<a href=“http://www.example.com/quotes-and-poems/quote-marcel-proust” title=“Permanent link to this article”>Quote – Marcel Proust</a>
Add the rel=“bookmark” code so it looks more like:
<a href=“http://www.example.com/quotes-and-poems/quote-marcel-proust” class=“contentpagetitle” title=“Quote – Marcel Proust” rel=“bookmark”>Quote – Marcel Proust</a>
</code>

Currently I am using the following for my post titles:
<code><h1><txp:permlink><txp:title /></txp:permlink></h1></code>
I would appreciate your advice on how I can add those additional attributes they mentioned.

Offline

#5 2006-03-24 18:50:05

NyteOwl
Member
From: Nova Scotia, Canada
Registered: 2005-09-24
Posts: 539

Re: W3C Validation Error When Using Javascript And Listing on Technocratiy

Best place to start for tag info is <a href=“http://textpattern.net/”>TextBook </a>; in this case the <a href=“http://textpattern.net/wiki/index.php?title=Txp:permlink”>PermLink </a> entry.

The get the code as suggested you would do this:

<code><h1><a href=”<txp:permlink />” title=”<txp:title />” class=“contentpagetitle” rel=“bookmark”><txp:title /></a></h1></code>


Obsolescence is just a lack of imagination. / 36-bits Forever! / #include <disclaimer.h>;

Offline

#6 2006-03-24 20:45:17

coolhat
Member
Registered: 2006-03-11
Posts: 13

Re: W3C Validation Error When Using Javascript And Listing on Technocratiy

Thank you. This is great. I will now email Technorati to reload my posts into their server because they were not appearing before. I was not aware tags could be built within tags.
I just checked <code><txp:page_title /></code> and for optimizing my site was wondering if it is possible to reverse the sequence of listing <code>“Site Name: Article Name”</code> to <code>“Article Name: Site Name”</code>. This because I heard the Search Engines give highest priority to the first few words of the page title.

Offline

#7 2006-03-25 03:50:06

NyteOwl
Member
From: Nova Scotia, Canada
Registered: 2005-09-24
Posts: 539

Re: W3C Validation Error When Using Javascript And Listing on Technocratiy

Not using that tag but you could always use <code><title><txp:title />: <txp:sitename /></title></code> to get the effect you want.


Obsolescence is just a lack of imagination. / 36-bits Forever! / #include <disclaimer.h>;

Offline

#8 2006-03-28 07:39:15

coolhat
Member
Registered: 2006-03-11
Posts: 13

Re: W3C Validation Error When Using Javascript And Listing on Technocratiy

Ok, I put in this code and it does not seem to work. Here is my code:
<code>
<head> <meta http-equiv=“content-type” content=“text/html; charset=utf-8” /> <link rel=“stylesheet” href=”<txp:css />” type=“text/css” media=“screen” /> <title><txp:page_title /></title> <script type=“text/javascript” src=“http://www.haloscan.com/load.php?user=mememe”></script> <link rel=“alternate” type=“application/rss+xml” title=“RSS 2.0” href=“http://www.mysite.com/rss/” /> <link rel=“alternate” type=“application/atom+xml” title=“Atom 0.3” href=“http://www.mysite.com/atom/” />
</head></code>

Am I missing something or do I have to turn some setting on to allow the Title tag to be used in the header.

Offline

#9 2006-03-28 08:11:02

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: W3C Validation Error When Using Javascript And Listing on Technocratiy

You’ll need to use an article form. Here’s what I do:

<title><txp:if_section name=""><txp:sitename /><txp:else /><txp:if_article_list><txp:section title=1 /> · <txp:sitename /><txp:else /><txp:article form="title" /> · <txp:sitename /></txp:if_article_list></txp:if_section></title>

And in my “title” form I put: <txp:title />

Edit: I should add that to use this method, you need to have comment auto-append turned off.

Last edited by Mary (2006-03-29 05:13:09)

Offline

#10 2006-04-01 15:53:04

coolhat
Member
Registered: 2006-03-11
Posts: 13

Re: W3C Validation Error When Using Javascript And Listing on Technocratiy

Thank you for the detailed code Mary. I have tried it a couple of times and I think I am missing some setting because it is showing me the article url instead of the article name in the title. My guess is it is some general setting but I am not sure where it could be.

Offline

#11 2006-04-01 19:37:27

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: W3C Validation Error When Using Javascript And Listing on Technocratiy

What did you put in the “title” form?

Offline

#12 2006-04-01 22:25:33

coolhat
Member
Registered: 2006-03-11
Posts: 13

Re: W3C Validation Error When Using Javascript And Listing on Technocratiy

I created a new article form called “title” and put in this code:
<code><txp:title /></code>
And in the default page template I put in:
<code><title><txp:if_section name=”“><txp:sitename /><txp:else /><txp:if_article_list><txp:section title=1 /> · <txp:sitename /><txp:else /><txp:article form=“title” /> · <txp:sitename /></txp:if_article_list></txp:if_section></title></code>
to replace:
<code><title><txp:page_title /></title></code>

To understand the page template code I broke it down here:
<code><title><txp:if_section name=”“>
—-<txp:sitename />
—-<txp:else />
———<txp:if_article_list>
———<txp:section title=1 /> · <txp:sitename />
———<txp:else />
————-<txp:article form=“title” /> · <txp:sitename />
———</txp:if_article_list>
</txp:if_section></title></code>

Also please note I use two templates. One for the home page and the other for all articles, though both have the exact same header. My guess is this should not effect the result. So I am wondering if I am missing some site setting or something else.

Offline

Board footer

Powered by FluxBB