Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-09-04 13:21:49

lee
Member
From: Normandy, France
Registered: 2004-06-17
Posts: 831

CSS tag attribute

The css tag dosen’t allow for html tag ends, only xhtml tag ends. It always outputs /> when just > might be required.

Last edited by lee (2006-09-04 13:22:29)

Offline

#2 2006-09-04 14:10:04

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: CSS tag attribute

That should be compatible with HTML: <a href=“http://www.w3.org/TR/xhtml1/#guidelines”>http://www.w3.org/TR/xhtml1/#guidelines</a> (C2 emtpy elements).
By default <code><txp:css /></code> outputs an URL instead of a link tag, so the browser won’t even see the “ />” part of the <code><txp:css /></code> tag.

Offline

#3 2006-09-04 14:15:56

lee
Member
From: Normandy, France
Registered: 2004-06-17
Posts: 831

Re: CSS tag attribute

<code><txp:css format=“link” /></code> gives me <code><link rel=“stylesheet” type=“text/css” media=“screen” href=“http://www.mysite.com/textpattern/css.php?s=default” /></code> – it’s the /> I’m on about.

Last edited by lee (2006-09-04 14:16:15)

Offline

#4 2006-09-04 14:30:34

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: CSS tag attribute

Leave out the <code>format =“link”</code> attribute (or change it to ‘url’ instead of ‘link’). See the <a href=“http://textbook.textpattern.net/wiki/index.php?title=Txp:css_/”>examples</a> in the manual.

This should do what you want:
<code><link rel=“stylesheet” type=“text/css” media=“screen” href=”<txp:css />”></code>

Last edited by ruud (2006-09-04 14:31:52)

Offline

#5 2006-09-04 14:47:33

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,012
Website GitHub Mastodon Twitter

Re: CSS tag attribute

lee wrote:

<code><txp:css format=“link” /></code> gives me <code><link rel=“stylesheet” type=“text/css” media=“screen” href=“http://www.mysite.com/textpattern/css.php?s=default” /></code> – it’s the /> I’m on about.

textpattern is by default producing xhtml code. If you desperately need to have it as html you may just hard code the link to the stylesheet without the />. Having said that, it is not advisable as it will make migration of the site harder.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#6 2006-09-04 19:45:07

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: CSS tag attribute

If you’re needs aren’t that demanding (ie. You don’t use line breaks in Textile or TXP tag such as break=”“), all you need to do is edit /textpattern/publish/taghandlers.php. For me, it took about a minute or so to remove the “/>” from the image tags.

Offline

#7 2006-09-04 23:43:20

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: CSS tag attribute

Is there a reason for removing the “/”? It should be valid HTML, as ruud says.


Alex

Offline

#8 2006-09-05 00:21:41

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,081
Website

Re: CSS tag attribute

zem wrote:

Is there a reason for removing the “/”? It should be valid HTML, as ruud says.

Valid XHTML. nitpicker :).
Just as some people want to use the mimetype application/xhtml+xml for their site, some people want to serve it as valid HTML 401 strict (where the closing /> should be > for img tags, form controls, and some more, like the link tag for stylesheets, or feeds).
Both should be handled by a plugin. For the first one, that plugin exists. Someone takes up the job for HTML 401 ?


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#9 2006-09-05 00:41:40

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: CSS tag attribute

Ah, I was under the impression /> was always valid HTML4.


Alex

Offline

#10 2006-09-05 01:02:14

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: CSS tag attribute

Did some tests on validator.w3.org:
It doesn’t matter if the server sends it with content-type: text/html instead of application/xhtml+xml, as long as the doctype matches the rest of the (x)html code. For TXP, you should probably be using a XHTML doctype if you want it to pass validation.

The compatibility guidelines I linked to in my earlier response are only to make sure that your XHTML document can still be parsed by a HTML-only user agent.

Last edited by ruud (2006-09-05 01:03:11)

Offline

#11 2006-09-16 00:11:19

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: CSS tag attribute

phiw13 wrote:

Someone takes up the job for HTML 401 ?

Answering the call to duty :D

Offline

Board footer

Powered by FluxBB