This is a notification for Guests
Forums / All Other Contributions/Addons / String Replace at Intervals support

String Replace at Intervals support

Results 1 to 7 of 7
20 Dec 2010, 19:00
#1
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

String Replace at Intervals support

String Replace at Intervals has been submitted to Free Addons and should be available soon.

This is a coding utility which can be used to modify output strings. For example, you can add a <br /> or classname to every third occurrence of an element for formatting. This can be changed (dynamically, even) without touching the original generator.
There is also a version of the function which can handle single-level arrays as if they were strings, except that the string to be replaced cannot span across array element boundaries.

* You can replace every nth occurrence of a search string with another string.
* You can start replacement at any occurrence of the search string.
* You can start looking for occurrences of the search string at any position in the base string.
21 Dec 2010, 16:09
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: String Replace at Intervals support

String Replace at Intervals is now available in Free Addons.
19 Jun 2011, 10:48
#3
wirefram avatar

wirefram

New Zenner

Join Date:
Apr 2011
Posts:
95
Plugin Contributions:
0

Re: String Replace at Intervals support

hello

what is the use of this add-on?

thanks

:lookaroun
20 Jun 2011, 12:29
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: String Replace at Intervals support

Probably most commonly, you could add a line break or clearing element at desired intervals to make a plain list of automatically generated items wrap cleanly at every third, fourth or whatever item. Or it could be used to give a different style to the elements that will be first or last in each row of a multi-row listing.
10 Jan 2012, 15:25
#5
polygone avatar

polygone

New Zenner

Join Date:
Jan 2008
Posts:
73
Plugin Contributions:
0

Re: String Replace at Intervals support

Could this plugin be used to generate "Dynamic" attributes? In other words - based on one attibute selection the next attribute would change to a different name/value (And Price!)
Or would there be a better way to do this?
10 Jan 2012, 16:00
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: String Replace at Intervals support

No, this would not have anything to do with making attribute dependencies. For that you need javascript that interacts with the code. All this does is manipulate an output string.
27 Jan 2013, 08:36
#7
jewelsnpearls avatar

jewelsnpearls

New Zenner

Join Date:
Feb 2011
Posts:
29
Plugin Contributions:
1

Re: String Replace at Intervals support

I've studied this utility thoroughly, but being a newby at this, I can not find how to use it.
My menu is generated by means of the UL-generator, and what I would like is to have a clear:both inserted at the 5th and every following level2 of the menu... but how do I apply this module to do so?

See the pix (the frames are there for me to see what's happening when I change things)

I'm setting up a fixed menu on the home page (it's basically the dropdown menu without the drop down)

I now use 5 categories for testing, but in real life the site will have approx 20 categories.

In this case the Category 5 should be under Category 1;
How do I achieve this with your module?
I have no clue how and where to call it, and where to enter the variables...
Thanks in advance.