Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-11-20 17:06:48

Gocom
Plugin Author
Registered: 2006-07-14
Posts: 4,524
Website

rah_repeat // Split and repeat.

It’s all about splitting and repeating stuff. Turning comma delimiter separated lists into something else, like for example rich HTML lists. Has the ability to filter, remove duplicates and sort values.

Examples equal 1,000 words — and are lovely confusing. Enjoy pancakes:

<txp:rah_repeat value="mayonnaise, syrup, blueberry, breakfast" exclude="mayonnaise" trim="1" break="li" wraptag="ul">
	<txp:rah_repeat_value />
</txp:rah_repeat>

Gives following pancake fitting dressings, no mayonnaise:

<ul>
	<li>syrup</li>
	<li>blueberry</li>
	<li>breakfast</li>
</ul>

More info, examples and download

Last edited by Gocom (2011-12-02 11:37:19)

Offline

#2 2009-11-20 18:17:44

TNT
Member
From: Rotterdam, Netherlands
Registered: 2006-01-06
Posts: 246
Website

Re: rah_repeat // Split and repeat.

This is a great plugin. Clever!


Prrrrrrrr

Offline

#3 2009-11-20 19:14:01

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: rah_repeat // Split and repeat.

Looks like it will be very useful. Thanks!

Offline

#4 2009-11-20 20:03:08

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: rah_repeat // Split and repeat.

oh! just wanted to use php’s explode for cf fields… Now will look into your plugin :)


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#5 2009-11-22 23:43:44

PascalL
Member
From: Switzerland
Registered: 2009-03-09
Posts: 132
Website

Re: rah_repeat // Split and repeat.

Genius!

Offline

#6 2009-11-23 01:07:25

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 3,937

Re: rah_repeat // Split and repeat.

A mass-wrapping tool well-timed for christ-mass: Wrap the masses ;)

Cool gadget! Thank you, Jukka :)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#7 2009-11-23 04:35:07

Gocom
Plugin Author
Registered: 2006-07-14
Posts: 4,524
Website

Re: rah_repeat // Split and repeat.

Thank you all :)

Version 0.2 released. Changelog:

  • Added limit and offset.
  • Well made use of list when the list is a one item.

Rah_repeat for savior:

<txp:rah_repeat value="1|limit,2|offset">
	<txp:rah_repeat value='<txp:rah_repeat_value />' limit="1" delimiter="|">
		<h3>Change #<txp:rah_repeat_value /></h3>
	</txp:rah_repeat>
	<txp:rah_repeat value='<txp:rah_repeat_value />' offset="1" delimiter="|">
		<p>Added attribute <code><txp:rah_repeat_value /></code>.</p>
	</txp:rah_repeat>
</txp:rah_repeat>

See the changelog no-list again, more cool examples, updated attribute quides and have loads of *downloads*. Longest link ever.

Offline

#8 2009-11-28 13:12:01

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,781
Website

Re: rah_repeat // Split and repeat.

Nice: simple and elegant, and obviates my need for the old sed_packed_custom_fields (which I was only using in “foreach” mode).

Given that this deals with lists, wraptag and break would be nice additions.


Code is topiary

Offline

#9 2009-11-28 15:40:11

Gocom
Plugin Author
Registered: 2006-07-14
Posts: 4,524
Website

Re: rah_repeat // Split and repeat.

jsoo wrote:

Given that this deals with lists, wraptag and break would be nice additions.

Version 0.3 released ;) Adds:

  • Added attribute: wraptag.
  • Added attribute: break.
  • Added attribute: class.

More info and downloads

Offline

#10 2009-11-29 07:31:06

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: rah_repeat // Split and repeat.

I edited first version to add trim for exploded values. And my “hack” cleaned delimiter, if it was lonely left in the end of string. Here is the link for you, Jukka. May be this function will be useful for ver. 0.4 )


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

Board footer

Powered by FluxBB