Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-01-28 02:17:41

marknumberm
Member
From: Minneapolis
Registered: 2005-11-29
Posts: 46

Code in article titles

Not sure if this is technically a bug (may have been done on purpose) but it certainly leads to problems: It’s impossible to style just part of the article title.

A very good reason one would want to do this is to refer to the title of a book, as in an article title like this: A Review of Lake Wobegon Days, by Garrison Keillor

If you use <code><cite></code> or <code><i></code>, the “<” and “>” symobls get turned into html entities, so that A Review of <code><cite></code>Lake Wobegon Days<code><cite></code>, by Garrison Keillor becomes A Review of <code><</code>cite<code>></code>Lake Wobegon Days<code><</code>cite<code>></code> by Garrison Keillor in the HTML source code.

If you use textile, with underscores or question marks, it doesn’t get parsed at all, and your book title comes out with underscores or question marks on either side.

At least one other person have needed to style book titles in their article titles, a few other users have agreed this may be a bug, and it seems to be something that would present problems for many very mainstream uses of Txp.

A fix would be really nice. :)

Offline

#2 2006-01-28 02:26:00

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

Re: Code in article titles

How would we handle:

  • titles in RSS and Atom feeds
  • titles in emails
  • titles in lists (e.g. on the content > articles tab)
  • the title attribute of article permlink tags
  • the <title>...</title> tag
  • links in breadcrumbs
  • etc

Also, how do we distinguish between an article title like “big bold text”, and “about the <br /> tag”?

Remember, the solution has to also cope with a title like “a + b > c”

The current solution (titles are text without markup) solves all of these, so I don’t think we can consider this a bug report.

Last edited by zem (2006-01-28 02:52:50)


Alex

Offline

#3 2006-01-28 06:27:31

Anark
Member
Registered: 2004-08-14
Posts: 101

Re: Code in article titles

> I don’t think we can consider this a bug report.

Would you consider a feature request, then, to Textile-parse (inline elements only) headings?

Offline

#4 2006-01-28 06:34:57

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

Re: Code in article titles

Sure, if you can figure out how to solve those problems. (Textile parsing doesn’t solve them all)


Alex

Offline

#5 2006-01-28 08:01:55

Anark
Member
Registered: 2004-08-14
Posts: 101

Re: Code in article titles

Thinking out loud:

Say you limit Textile to boldfacing, italicising, and prettifying apostrophes and quotes.

Then you decide on a case-by-base basis whether to parse for Textile or whether to strip the underscores and the asterisks. You’d be sure to parse the entry title itself but you’d stip the the underscores and the asterisks for what goes inside the XHTML document’s title tags, for instance.

Offline

#6 2006-01-28 13:11:17

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Code in article titles

Hi all.
This also has been discussed here:

http://forum.textpattern.com/viewtopic.php?id=11648
http://forum.textpattern.com/viewtopic.php?id=12285
http://forum.textpattern.com/viewtopic.php?pid=84194#p84194

Maybe there are some ideas that can be implemented or added to this discussion.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#8 2006-01-28 16:58:09

marknumberm
Member
From: Minneapolis
Registered: 2005-11-29
Posts: 46

Re: Code in article titles

Anark’s solution sounds to me as though it would work.

Allow just a few Textile modifers; parse them in some cases; strip them off in others.

Offline

#9 2006-01-28 17:19:49

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Code in article titles

I certainly wouldn’t object to some form of “lite” textile like we used to have with comments. Bold text and italics would definitely be welcome for my part. Anything else would be a bonus. It would be nice to be able to put at least a little bit of expression into post titles. :)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#10 2006-01-28 17:41:19

marknumberm
Member
From: Minneapolis
Registered: 2005-11-29
Posts: 46

Re: Code in article titles

Also, how do we distinguish between an article title like “big bold text”, and “about the <br /> tag”?

One more thought: yes, I know people use txp to write articles about code and therefore have a need to include HTML tags etc. in article titles. But as it stands, I think we’re giving up a lot to gain just a little.

To wit, it’s now very easy to title an article “about the <h1> tag” but it is impossible to have a title that reads “Themes in Shakespeare’s Macbeth

There are lots of coders here on the forum, so being able to write an article about <h1> and have the tag appear, without fuss, in the article title might seem pretty important. But think of all the more mainstream users; I expect that to most of them, being able to refer properly to the title of a book would be far more important.

Offline

#11 2006-01-29 00:51:10

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: Code in article titles

an article NAME and an article TITLE ? : )

good thing big displays are becoming cheaper!

Offline

#12 2006-01-29 01:02:47

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

Re: Code in article titles

If someone sends a patch, we’ll take a look.

To wit, it’s now very easy to title an article “about the <h1> tag” but it is impossible to have a title that reads “Themes in Shakespeare’s Macbeth

The failure mode for the current method is a minor cosmetic degradation.

The failure mode for Textile would be broken feeds, broken HTML, and an increased support load.


Alex

Offline

Board footer

Powered by FluxBB