Textpattern Forum

You are not logged in. Register | Login | Help

#11 2005-05-20 12:57:03

supa
Plugin Author
Registered: 2005-02-10
Posts: 27
Website

Re: [archived] sab_substr

Wow, How’s that for a pie in the face?

It won’t work with links unless the link is around the <code><txp:sab_substr /></code> plugin, like:

<code>
<a href=“blah.html”><txp:sab_substr limit=“15”>content goes here</txp:sab_substr></a>
</code>

Sorry :(

-sab

Offline

#12 2005-05-20 16:03:06

sekhu
Member
Registered: 2005-05-12
Posts: 428
Website

Re: [archived] sab_substr

hmm i’m a muppet I don’t know why I surrounded the tag with the cat isnide – it’s not the cat i;m truncating. i want to trancate the article title…

so, would this work?

<pre>
<h3 class=“music”>
<txp:permlink>
<txp:sab_substr limit=“10” trail=”…”>
<txp:title />
</txp:sab_substr>
</txp:permlink>
</h3></pre>

EDIT: That didn’t work either – is there no other way to truncate titles? It really would be something I could use and would save me having to limit users to how long titles are.

Last edited by sekhu (2005-05-20 16:42:11)

Offline

#13 2005-07-24 17:26:38

sekhu
Member
Registered: 2005-05-12
Posts: 428
Website

Re: [archived] sab_substr

This plugin doesn’t work with rev608 haven’t just upgraded – can anyone fix this? Have uninstalled and reinstalled but no luck.

thanks

EDIT: My mistake I forgot the offset tag is now used instead of just limit x, x.

cheers

Last edited by sekhu (2005-07-24 17:29:32)

Offline

#14 2005-07-24 18:25:55

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

Re: [archived] sab_substr

Cool. This is fantastic. I have altogether new plans to use this plugin. (I’ll be using this plugin as a drop-cap). But i would like to see one more function being added. (If you can)

I would like to display all the letters of a paragraph except the first letter.

Eg. Instead of “The quick brown fox jumps over the lazy dog”

I would like to display it as “he quick brown fox jumps over the lazy dog”. (In short I would like to strip of the first letter).

The code…

<code>
<div class=“dropcap”> // A class to create a drop-case
<txp:sab_substr limit=“1” trail=”“><txp:body /></txp:sab_substr></div> // Displays the first letter of the body.
<txp:sab_substr strip=“1”><txp:body /></txp:sab_substr> // Displays everything else other than the first letter.
</code>
<br />
<a href=“http://www.citrusmoon.net/dropcaps.html”>THE RESULT</a><br /><br />

Last edited by creativesplash (2005-07-24 18:27:57)


“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”

— Albert Einstein

Offline

#15 2005-07-24 19:23:59

paularms
Member
From: University of Minnesota
Registered: 2004-10-21
Posts: 155
Website

Re: [archived] sab_substr

creativespash: that seems like a bad idea…

instead, why don’t you try my sexy drop-caps, which use pure CSS? This would create less processes for each page.

Offline

#16 2005-07-24 19:34:19

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

Re: [archived] sab_substr

Yeah I know about this. But the problem is it wont display in IE. My audiences primarily use IE.


“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”

— Albert Einstein

Offline

#17 2007-07-27 13:49:06

fas.khan
Member
From: Paris
Registered: 2007-06-06
Posts: 41

Re: [archived] sab_substr

Hello all,

I am into this same problem where I want to trim the Title (<txp:title />) length and put (…) at the end. It seems that this plugin can do the jo, but I really dion’;t where to get this plugin.

The site www.bluecamel.org is not working.

Can I anyone suggest me where to get this plugin or any other way how to accomplish it ?

Thanks.

Offline

#18 2007-07-28 12:06:38

ruud
Developer emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 4,538
Website

Re: [archived] sab_substr

An attempt to recreate the plugin code (requires TXP 4.0.4 or higher).
Tag usage is identical to the one described at the beginning of this topic. This one should behave UTF8-aware and assumes the enclosed content has not yet been HTML escaped(default limit = 10, default trailing char is the ellipsis character).

download plugin

Last edited by ruud (2007-07-29 13:57:12)

Offline

#19 2007-07-29 14:47:57

fas.khan
Member
From: Paris
Registered: 2007-06-06
Posts: 41

Re: [archived] sab_substr

Whoa …

Now this is the way Dutch Bell the Cats … :-)

Done ! …

Thank you so so much …

Offline

#20 2007-08-09 22:31:46

Sam
Member
From: Edinburgh, Scotland
Registered: 2004-06-26
Posts: 124
Website

Re: [archived] sab_substr

Hi Ruud, thank you very much for updating this plugin!

I am having a little trouble with unencoded html entities, a lot of &#8217; and &#8211;.

I also modified the plugin slightly to include $thing = strip_tags($thing); to remove html tags as I am using it to output txp:body content.

Any help with the html codes would be great!

Last edited by Sam (2007-08-09 22:34:19)

Offline

Board footer

Powered by FluxBB