Software

Hop Inject

Current Version: 3.0.0

We developed Hop Inject to solve a very common but tricky problem: We wanted to place an advertisement after the third paragraph on a page. But, since this is EE we’re talking about, of course the third paragraph was in an entry custom field, and it was hard to add at run time. In addition, we thought, what if we wanted to add a photo after the fourth paragraph? Or another advertisement after the tenth paragraph? Or a pull quote after the sixth and ninth? What if we want to let editors add images into stories wherever they want, but they don’t know HTML? (Shocking, I know.)

Hop Inject does the trick. It lets you specify where an injection should occur (such as, “on paragraph tags”); it lets you specify which of those elements should get the injection (for example, “the third and the eighth”); and it lets you specify what the injection should be. It also lets you choose whether the injection should occur before or after the element.

Sound like a problem you’ve run into, too? Well, it’s not a problem anymore!

This version is compatible with EE 2.1.3 and later (and probably NOT with 2.1.1 and earlier).

Version 1.2 adds the ability to inject counting up from the bottom of a block of content, as well as down from the top.

Credit: This was inspired by Leevi Graham’s LG Replace but we didn’t want to have to include search markers in the body content; that plugin gives you exact targeting, but this plugin keeps your data uncluttered and re-useable.