PEAK XOOPS - D3Pipes - TRUNCATE this clipping option - a suggestion in englishin japanese

D3Pipes - TRUNCATE this clipping option - a suggestion

  • You cannot open a new topic into this forum
  • Guests cannot post into this forum
Previous post - Next post | Parent - Children.1 .2 | Posted on 2007/8/18 3:20
Nobelium  ¸àĹ   Posts: 47
Sorry to "suggest" a bunch, but as issues come up, I figured I'd let you know.

There used to be a truncate type function in XHLD. It was nice being able to select exactly how much text you needed of an item.

And, if ya got the time, just how does that text replacement filter work...IE syntax? Is there a description of the filters I've missed somewhere?

For instance, to replace simple text in any clipping coming into a pipe:

using mbregex option I guess (is there better option selection for this simple example? That regex is tricky)

search - \Bob Smith\
replacement - \Bob "Big Head" Smith\

would that do the trick?

Thanks again and great modules(s)
Votes:1 Average:10.00
Previous post - Next post | Parent - Children.1 | Posted on 2007/8/19 11:42
GIJOE  ÀèǤ·³Áâ   Posts: 4110
I'm sorry that I cannot understand what you mean.

What is truncate?
Do you mean "replacement" of entories like this?

s/Bob Smith/Bob "Big Head" Smith/g

If you want "filtering", just use some kind of filter joints.
Votes:0 Average:0.00
Previous post - Next post | Parent - Children.1 | Posted on 2007/8/20 1:03
Nobelium  ¸àĹ   Posts: 47
Truncate is cutting off the entry's content/text at a variable (TRUNCATE) point.

Say an rss feed entry is 1000 characters total.

The TRUNCATE (filter) would/could chop that to whatever you wanted, say 300 characters. And then display it or insert into the db.

This allows grabbing only a portion of the feed, yet a pre-defined portion that fits your publishing/styling needs (300 characters for example) exactly.

It's like the "Max bytes of title" in the XHLD module block, except this applies to the whole content/description of the item.

BTW, that "Max bytes of title" in the XHLD block was very useful.

Maybe the TRUNCATE filter could apply to either the title or the content or both.


As for the TEXT REPLACEMENT (filter)...

Is this for the title only? Or can it apply to the description/content as well? Cause that's what I need. To be able to replace a particular string in the content of the rss feed item with another string.

thanks.
Votes:0 Average:0.00
Previous post - Next post | Parent - No child | Posted on 2007/8/20 6:37
GIJOE  ÀèǤ·³Áâ   Posts: 4110
Max bytes?
Just edit the template.

eg) *_inc_entries.html
<{$entry.headline|truncate:"20"|escape}>

And it is not so difficult to implement a "replacement" joint you want.
It should be placed as joints/reassign/D3pipesReassignPregreplace.class.php
Votes:0 Average:0.00
Previous post - Next post | Parent - Children.1 | Posted on 2007/8/23 1:27
Nobelium  ¸àĹ   Posts: 47
Thanks GIJOE for that tip...I figured it was possible via the template (it can be used for some situations), but the real issue is this...

Truncating before entering the data into database (some feeds entries can be huge) would be very useful.

And, more importantly, some RSS feed providers request you only show a portion of their feed to be fair to them. I respect that. While others encourage full feed display and sometimes include ads to help their bottom line.

So, some feeds you need to be truncated, others not. Thus the need to truncate them before you display them. Changing the template truncates ALL the feed entries the same.

Thanks.
Votes:0 Average:0.00
Previous post - Next post | Parent - No child | Posted on 2007/8/23 6:05
GIJOE  ÀèǤ·³Áâ   Posts: 4110
Quote:

Nobelium wrotes:
Truncating before entering the data into database (some feeds entries can be huge) would be very useful.

And, more importantly, some RSS feed providers request you only show a portion of their feed to be fair to them. I respect that. While others encourage full feed display and sometimes include ads to help their bottom line.

So, some feeds you need to be truncated, others not. Thus the need to truncate them before you display them. Changing the template truncates ALL the feed entries the same.
It sounds reasonable.
OK.

I've just added a joint ReassignTruncate into 0.53.
Try it!
Votes:1 Average:10.00

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!