Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-01-27 04:56:04
- marknumberm
- Member

- From: Minneapolis
- Registered: 2005-11-29
- Posts: 46
Style part of an article title
I often need to italicize just a few words within my article titles, such when an article title refers to the title of a book.
However, ‘<code><cite></code>The Rights of Man<code></cite></code> by Thomas Paine’ gets published as ‘<code><cite></code>The Rights of Man<code></cite></code> by Thomas Paine’. It doesn’t italicize the words that have the tag around them.
Same thing when I use textile underscores or double question marks or the <code><i></code> tag.
Any way to remedy this?
Offline
Re: Style part of an article title
You may have a problem there. I don’t believe “titles” are textiled and I also think HTML tags are a none-starter too. I was wondering whether you could put your titles into the article itself and adjust your form, or have a second form, to not use the “title block”? The only thing I can’t get my imagination around is whether it would link to the “individual_article” view properly. I think it should provided you get the URL right. All I can suggest is that you give it a try.
Last edited by thebombsite (2006-01-27 11:45:36)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#3 2006-01-27 12:18:06
- Anark
- Member

- Registered: 2004-08-14
- Posts: 101
Re: Style part of an article title
Is there a good reason why Textile doesn’t parse titles?
Offline
Re: Style part of an article title
Not being one of the devs I can’t be 100% but it may have something to do with the “permlink” and producing a properly formatted URL.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#5 2006-01-27 14:06:13
- marknumberm
- Member

- From: Minneapolis
- Registered: 2005-11-29
- Posts: 46
Re: Style part of an article title
Well, this stinks.
It seems to me that this is an issue that would have come up before. But I can’t find anything any where.
Offline
#6 2006-01-27 14:19:26
- Anark
- Member

- Registered: 2004-08-14
- Posts: 101
Re: Style part of an article title
It rather looks like an oversight to me.
Wordpress manages to pull off italics and curly apostrophes in post titles while outputting non-crufty URLs based on such titles.
Offline
#7 2006-01-27 14:23:42
- Anark
- Member

- Registered: 2004-08-14
- Posts: 101
Offline
Re: Style part of an article title
Go for it. :) It would be nice not to have to use “plain” titles.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#9 2006-01-28 02:19:05
- marknumberm
- Member

- From: Minneapolis
- Registered: 2005-11-29
- Posts: 46
Re: Style part of an article title
I reported it.
Anark and Thebombsite, please take a look to make sure I got the details right.
Offline
Re: Style part of an article title
I would like very much to second, third, and fourth this request. I need to be able to use all manner of unicode and html elements in my article titles—punctuation marks, emphasis, bolding, line breaks. Other blogging software I’ve used has parsed them with little to no effort, though WordPress peculiarly chokes on quotes in a tag in the title, so anything calling a CSS class is right out, but still: they can handle them with no problem and dirify them for building links and suchlike.
Not having the ability to style titles or parts of titles is a severe lack, from my own particular style-over-substance point of view. It’s pretty much a deal-breaker. Is there any sort of hack or workaround or plugin?
(What’s <em>really</em> annoying is the markup previews appropriately in the article preview window, and it shows up just as it should on any admin lists. So me, behind the scenes, I can see it all properly and it looks fine. But on the front page where it should be pretty it all goes kerflooey.)
(Aha! Okay, so I need to revert back to 4.0.1 and use <a href=“http://forum.textpattern.com/viewtopic.php?id=12285”>these plugins</a>. Until, at least, it’s addressed in a more official fashion. —Off to figure out how to revert…)
Last edited by kiplet (2006-01-29 17:02:00)
Offline
#11 2006-01-29 16:55:54
- marknumberm
- Member

- From: Minneapolis
- Registered: 2005-11-29
- Posts: 46
Re: Style part of an article title
Hi, Kiplet.
If you wouldn’t mind, please take a second to log your concerns on the feature request post I made on this topic. I think it’s good for it all to be assembled together.
As far as a plug-in or hack, it looks as though there is not any work-around of any kind right now.
Offline
Re: Style part of an article title
Yeah, I posted there too, thanks. And I edited my comment above. It looks like you used to could do it, and now I’m off to figure out how to revert until someone more officially tweaks the code.
Offline
Re: Style part of an article title
The other option would be, of course, to dirify by hand: enter a properly compliant title in the title field; enter the title as you want it styled, wrapped in a header tag, in the body of the article; and set your page templates not to display the title field in the body, just the article itself.
(Added: or one of the alternate content fields? Copy the contents of title to a new field in the database, and use that? But I’d still have to dirify the titles by hand to strip out the crap…)
But holy Mary Mother of God, I’ve got 800+ posts to check and load.
—Does anyone have a copy of 4.0.1 sitting around I could borrow?
Last edited by kiplet (2006-01-29 17:50:19)
Offline
Re: Style part of an article title
Okay: just wanted to update this a bit with the solution I’ve come to, which, yes, is work, work I didn’t want to do, but. First, though, I wanted to clip something I saw quoted elsewhere:
I often want TXP to do something automatically but then when I step back and try to figure out how to do it TXP’s way I realize that it’s almost always a more flexible and better solution.
That’s neutrino, over in <a href=“http://forum.textpattern.com/viewtopic.php?id=13542”>this thread</a>, which has an amusing line comparing Drupal to an ATV, but anyway, as a Textpattern noob, I’m sticking that to the wall or something. Yes, what I’ve come up with requires precisely the work I was whingeing about before, but in the end I’ll have something as flexible as I wanted and moreso.
Anyway: the solution.
I renamed one of the custom fields to title_typog, since that was clear enough for my purposes. Then I copied the fully marked-up version of the title to that field, and stripped markup out of the title stored in title. Then, in the various article forms, I went hunting for the following code:
<code><txp:title /></code>
And replaced it with this:
<code><txp:if_custom_field name=“title_typog”>
<txp:custom_field name=“title_typog” />
<txp:else />
<txp:title />
</txp:if_custom_field></code>
That checks to see if there’s a value in title_typog, and uses that value if there is, and if not reverts to title.
One of the benefits I hadn’t stopped to think of in doing it this way is I want some archive pages to list article titles in a particular list-like fashion, which wouldn’t work with the punctuation I usually use at the end of article titles. This way, I can use the value stored in title for that list, and the value stored in title_typog when it needs to be all shiny and pretty.
Which, forgive me if I’ve gone on too long about something that seems simple enough on the face of it, but: important truth learned. Stop and think and see what you can do with the tools at hand, I guess. (Yes it would be nice to set this up automagically, but truth be told I’d get in there and muck with the resulting titles manually anyway, most like.)
One downside: unicode entered into a custom field saves properly to the database, but if the article is brought up again, that unicode is converted to its “proper” character—&#8217; becomes ’ and when you save the article a second time, the ’ replaces the &#8217; in the database. Which is annoying. But.
Offline
Re: Style part of an article title
BIG thank kiplet, You help me a lot.
BR
Pedronx
Offline
Pages: 1