Published by Mijingo

movie icon image

EE Insider Blog

Spend your time learning and developing sites with ExpressionEngine and we'll use this blog to keep you informed of all the news related to ExpressionEngine and CodeIgniter.

» Read more in the Archives.

» Have a tip? Send us your EE news.

Learn ExpressionEngine Today

Over a series of 8 videos, watch and learn as Ryan builds an entire ExpressionEngine website from beginning to end. Get started now.

SurgerEE: A collection of small bites of functionality.

I got an email last week from Pete Sena at Digital Surgeons to let me know about a new plugin they’ve released that is (and will become larger as more tags are added) a collection of small bites of functionality that are overkill for a single plugin and not really necessary as a PHP implementation. The add-on is called SurgerEE.

Pete wrote:

We’ve all been there: a client’s ExpressionEngine site has been up for a month or so, but to accommodate some change in their product (service, etc.) they need some new functionality. Naturally, it’s a request that sounds very simple to the development uninitiated, but doesn’t quite fit into the way their site was originally built. So then the template surgery begins. Rewriting loops, looping within loops, and finally giving in to the temptation to “just use PHP”. Followed by being bitten by template parse order when attempting to use PHP. Then you arrive at the ultimate solution: You need to write or find a simple plugin to tease the right behavior out of the standard template tags.

Digital Surgeons wants to “unify small plugins to reduce bloat in your third_party folder” with SurgerEE. They’ve released it with an open source license and put the add-on up on GitHub. They want the community to add more tags to the plugin, so it becomes more useful for everyone. Think of this as a catch-all for the functionality in the dozens of plugins that only do one small thing.

Here’s what they have so far:

  • Mathematical Helpers
    • Modulo - I’ve written this in PHP dozens of times.
    • Ceil Divide - Division, rounded up!
  • Logical Helpers
    • Halfway - Check if you’re halfway through a loop (you specify the total count).
    • Years - This one replaces my YearList plugin!
    • Loop - Loop and divide.
    • Url_title to Entry_id - Gets the entry_id for the url_title that is passed into it.
  • String Manipulation Helpers
    • Replace - A simple regex tag that replaces something with something else.
    • Match - Find a match in a string.
    • Proper Title - Makes a proper (without the underscores or hyphens) title of the url_title you pass it.
    • Strip Tags - Not Ryan Masuga’s favorite game in college but instead an easy way to strip out HTML from whatever you wrap with the tag pair.

The add-on is free and open to the community for suggestions and additions. Find the source on GitHub or more information over at Devot:ee.

Posted on Jun 11, 2012 by Ryan Irelan

Filed Under: Development Tools, EE Add-ons, EE Plugins