Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: How: linebreak in article-title?
hi whatbrick, thanks much for that.. that does solve the prev_title/next_title and txp:title tags…
but then <txp:recent_articles />
doesn’t parse the html…. :-/
seems like plugging the problem one way works with some tags, but doesn’t work consistently across all the Textpattern tags.
I really do need a way to underline, italicize, or bolden portions/specific words in some of my article titles.
I might have to hack it together using custom fields or something?
But would be really nice if I could just use the regular titles..
textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation
Offline
#26 2006-08-31 22:49:51
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,310
Re: How: linebreak in article-title?
whatbrick:
Hey, uli, I found your problem.
glad that it was nothing on my side. i’m too fresh with txp to be capable of judging which part of the engine exactly needs my attention.
and great to hear that at least i can use tags in titles from now on (i don’t want to expect this of html laymen), even before a more versatile plugin for this task gets written.
@ all: i got this thread on the road as a reservoir for ideas about what a plugin might do.
Last edited by uli (2006-08-31 22:53:48)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#27 2006-09-01 01:06:38
- whatbrick
- Member
- From: Texas
- Registered: 2006-03-13
- Posts: 100
Re: How: linebreak in article-title?
The big problem is getting the titles to appear their best in any/all situations. The markup you choose for the main title may look odd when listed using the <txp:recent_articles />
, <txp:related_articles />
, <txp:page_title />
or <txp:recent_comments />
tags (or any others that I may have left out).
It should be interesting to see what developes.
Do not taunt the Markup Monkey!
Offline
Re: How: linebreak in article-title?
Not sure if this has been addressed in other threads (tried a search), but I wonder if someone could tell me how to tell Textpattern not to convert spaces to <code>  ;</code>? It’s barking with sfir.
Thanks!
“If you build it, they will come.”
Offline
Re: How: linebreak in article-title?
I second the need to be able to apply minimal, semantic formatting to article titles. For example, wanting to include an acronym or book title (which should be italicized) in an article title seems quite common. For now, we can certainly use whatbrick’s solution, but from the point of view of most authors (I think) it makes more sense to apply the html to titles, and then use html entities for brackets, etc. when you actually want to show some tags in your title. What do others think?
Offline
Re: How: linebreak in article-title?
nabrown78 wrote:
I second the need to be able to apply minimal, semantic formatting to article titles.
I very much agree.
textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation
Offline
#31 2007-06-07 10:19:00
- alexandra
- Member
- From: Cologne, Germany
- Registered: 2004-04-02
- Posts: 1,370
Re: How: linebreak in article-title?
Does anybody know if there is already a plugin available for formatting article titles? I checked textpattern resources but could not find one.
Last edited by alexandra (2007-06-07 10:19:23)
Offline
#32 2007-06-07 12:43:29
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,310
Re: How: linebreak in article-title?
There is nhn_typotuner by Nils Hörrmann for textiling titles and excerpts [there’s also one by Mary, but I don’t have the name around (—> www.utterplush.com?)], and for inserting linebreaks Juanjo Navarro’s jnm_wrap. I don’t yet know about anything for coloring single words. (textile an classes didn’t work too reliably the last time I tried)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: How: linebreak in article-title?
You can use the code snippet on the first page of this thread. Instead of putting <txp:title />
in your article form, use
<txp:php>
global $thisarticle;
echo $thisarticle['title'];
</txp:php>
Then you can use <br /> (which can still be semantic if all you intend is to specify a line break for ease of reading) in your title or any other html such as <cite>, which can come in handy if you are referencing a book in your title, for example.
Offline
#34 2007-06-07 19:50:06
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,310
Re: How: linebreak in article-title?
Aah, thanks, nabrown78, didn’t have in mind anymore that whatbricks snippet enables adding a span to the title. At the time of the above discussion I was satisfied with adding simple line breaks.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#35 2007-06-09 20:32:39
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,310
Re: How: linebreak in article-title?
alexandra:
Does anybody know if there is already a plugin available for formatting article titles?
I’ve recently written a little tute on how to style article titles
Last edited by uli (2007-06-11 00:07:44)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#36 2022-04-25 03:17:28
- peterj
- Member
- From: Melbourne, Australia
- Registered: 2005-06-02
- Posts: 99
Re: How: linebreak in article-title?
15 years later but still relevant. No need for any messy methods now though – as of TXP 4.7., you can just do this:
<txp:title escape="" />
So this “My breaking<br>news” title displays as:
“My breaking
news”
Note that this may cause weirdness wherever else the title shows up (eg search, sitemap, rss), so use with caution.
I’m only thinking of using where the title field is being co-opted into use as “big text” in a display panel or block layout within another article. Probably a safer idea is to leave the title sans html, and use custom fields if any fiddly stuff is required. Something like:
<txp:if_custom_field name="formatted_title">
<txp:custom_field name="formatted_title" escape="" />
<txp:else />
<txp:title />
</txp:if_custom_field>
<txp:body />
Offline