1 personman Jun 04, 2005 18:08
3 personman Jun 06, 2005 21:10
I guess I still have a lot to learn about XHTML. I tried your code, but I get
Invalid post, please correct these errors:
* Tag p may not have attribute id
I assume that I can add that in the _formatting.php file. But even then, if I try to add this link:
<a href="#footnote">1.</a>
It's giving me the invalid url message. I can't put the full url in because I'll lose all of the GET data in the permalink.
4 strangnet Jun 06, 2005 22:04
Use
<a id="name"></a>
5 personman Jun 06, 2005 22:08
Invalid post, please correct these errors:
* Tag a may not have attribute id
6 strangnet Jun 06, 2005 23:54
Ah, the xhtml-checkup is a bit broken - or there's a reason for this behavior...
7 hundiejo Jun 07, 2005 00:01
Is there any way to edit the XHTML checker? add things to skip over?
8 personman Jun 07, 2005 01:39
The file you need to edit is conf/_formatting.php. It's not easy to edit. And I've only had partial success with it. As usual, back it up before you start editing it. It's also possible to disable the validator entirely.
9 graham Jun 07, 2005 12:52
And the xhtml checker wants links to be fully formed, eg http://domain.com/page.html#place, not just #place.
10 hundiejo Jun 08, 2005 19:59
I got it to work.
In thumbing around the _formatting.php I found this:
'a' => A_attrs.' charset type href hreflang rel rev shape coords target', // Transitional
Looked like the attributes that the checker would allow for the a tag, so I added "id" and "name":
'a' => A_attrs.' charset type href id name hreflang rel rev shape coords target', // Transitional
Now it works fine. Take a look:
[url=http://www.hundiejo.com/philosophy/index.php/a/2005/04/25/philosophy_computers_and_bad_writing]Final for Capstone[/url]
Update: I added "to" and "from" anchors for the footnotes so that readers can go back to where the footnote is in the document after reading the note.
11 personman Jun 08, 2005 20:46
Nice.
12 isaac Jun 09, 2005 22:31
Hacking _formatting.php to allow the ID attrib on an empty A tag isn't really the way to go.
Look in conf/_formatting.php for this bit:
// Allowed Attribute classes
define('A_coreattrs', 'class title id');
define('A_i18n', 'lang xml:lang dir');
define('A_attrs', A_coreattrs.' '.A_i18n);
That defines ID as one of the A_coreattrs, and then defines A_attrs as the union of A_coreattrs and A_i18n.
Then, there's this bit:
// Array showing allowed attributes for tags
$allowed_attribues = array
(
// 'div' => A_attrs, // Strict
'div' => A_attrs.' '.A_TextAlign, // Transitional
// 'p' => A_attrs, // Strict
'p' => A_attrs.' '.A_TextAlign, // Transitional
So, P elements should be allowed to have ID attribs. Not sure why you're having a problem with that. My blog lets me do that just fine. Have you altered _formatting.php before? What version are you using?
The reason why <a id="footnote"></a> is a bad solution is because the A element isn't the footnote, so that "solution" violates a basic principle of semantic markup.
The P element, at the bottom of the page or wherever, actually is the footnote, so it makes more sense to simply identify it as such, with the ID attrib so that the browser can anchor to it with a hyperlink. See?
As for needing the full URL, yes that's somewhat of a PITA. Anyone wanna figger out what has to happen to get around that? I just use the post permalink url with the hash, since that's probably the page that it'll show up on anyhow.
13 isaac Jun 09, 2005 22:37
Oh, another thing:
ID attributes must start with a letter. That could have been the source of your problem, maybe?
14 john Jun 10, 2005 17:25
In the most recent release of B2Evo this is what is in that section of conf_formatting... note no mention of "id"
first instance..
/ Allowed Attribute classes
define('A_coreattrs', 'class title');
define('A_i18n', 'lang xml:lang dir');
define('A_attrs', A_coreattrs.' '.A_i18n);
define('A_TextAlign', 'align'); // Transitional only
define('A_cellhalign', 'align char charoff');
define('A_cellvalign', 'valign');
second instance..
// Allowed Attribute classes
define('C_A_coreattrs', 'class title');
define('C_A_i18n', 'lang xml:lang dir');
define('C_A_attrs', C_A_coreattrs.' '.C_A_i18n);
define('C_A_cellhalign', 'align char charoff');
define('C_A_cellvalign', 'valign');
Is "id" supposed to be there??
15 isaac Jun 10, 2005 20:09
I'm not sure why it was apparently removed (i'm not using the most recent b2evo release - haven't yet had a chance to port all my hacks up to that version.)
It could be simply that ID attribs need to be unique on the document, and we have no way to ensure that's the case.
In any event, you can simply add it to the A_coreattrs definition, rather than defining it just for A tags.
16 john Jun 11, 2005 01:00
it could be simply that ID attribs need to be unique on the document
From a standards point of view that is correct and how it should be
I really think personman should be looking at the possibilities of using the <cite></cite> tag in some way.
A detailed post and discussion on quotes and citations can be found at [URL=http://www.456bereastreet.com/archive/200411/quotations_and_citations_quoting_text/]Quotations and citations: quoting text | 456 Berea Street[/URL] and may be some use in providing an alternative solution.
Anchors within posts seems to be a real problem
It's really not valid XHTML code.
Named anchors have been deprecated in favor of the ID attribute. Instead of
you should use
page.html#footnote will properly access either one.
What's the URL that's invalid? Is it just because there's an A tag without a HREF?