Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-07-02 04:22:30

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Abbreviating titles ...?

Anybody know if there’s a way of outputting an abbreviated version of an article’s title?

For example, displaying the first 4 words of “This is a title which is very long” to make “This is a title”.

I guess it’s the functionality of rss_auto_excerpt I’m looking for.

I’ve written a plugin that can do it but I’m curious if there’re other ways.

Thanks.

Offline

#2 2008-07-02 09:34:11

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

Re: Abbreviating titles ...?

plugin: rvm_substr (cuts a specific number of characters, not words)

Offline

#3 2008-07-02 10:46:16

fpradignac
Plugin Author
From: France near Cognac
Registered: 2005-01-29
Posts: 359
Website

Re: Abbreviating titles ...?

Hello,

beginning should do the trick.

But kgr_safe_excerpt can count your words.

Last edited by fpradignac (2008-07-02 10:48:36)


françois

Offline

#4 2008-07-02 13:00:44

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: Abbreviating titles ...?

ruud wrote:

plugin: rvm_substr (cuts a specific number of characters, not words)

Thanks Ruud. It’s not quite what I’m after, but interesting nonetheless. You should list it on textpattern.org

Offline

#5 2008-07-02 13:04:53

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: Abbreviating titles ...?

fpradignac wrote:

beginning should do the trick. But kgr_safe_excerpt can count your words.

Thanks François. Both these plugins appear to work along the lines of rss_auto_excerpt. I needed something to work on the article title, not the body.

Offline

#6 2008-07-02 14:58:25

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

Re: Abbreviating titles ...?

I’d skip “beginning” because it doesn’t adhere to plugin prefix standards.
You can probably modify rss_auto_excerpt quite easy to work on the title instead of the excerpt.

Offline

#7 2008-07-02 15:24:22

fpradignac
Plugin Author
From: France near Cognac
Registered: 2005-01-29
Posts: 359
Website

Re: Abbreviating titles ...?

Sorry gomedia, I forgot that it was only on title.


françois

Offline

#8 2008-07-02 16:02:54

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,529
Website GitHub Twitter

Re: Abbreviating titles ...?

Use rss_auto_excerpt like this:

<txp:rss_auto_excerpt words=“4” body=“title” />

That should work!

Cheers

Offline

#9 2008-07-03 13:12:39

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: Abbreviating titles ...?

Dragondz wrote:

Use rss_auto_excerpt like this:
<txp:rss_auto_excerpt words=“4” body=“title” />

Thanks Dragondz. Yes it does work. I’m using txp:rss_auto_excerpt elsewhere but never thought that it could operate on a title.

Offline

#10 2008-07-06 03:02:04

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: Abbreviating titles ...?

I’ve taken the plunge and released a plugin called adi_title to abbreviate article titles in various ways. I hope it’s of some use.

Offline

Board footer

Powered by FluxBB