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.
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:
Modulo - I’ve written this in PHP dozens of times.
Ceil Divide - Division, rounded up!
Halfway - Check if you’re halfway through a loop (you specify the total count).
We wanted to give you a heads up that we updated the Twitter Timeline plugin to address a security issue. We consider this one critical as it can result in unexpected information disclosure. Both ExpressionEngine 1 and 2 versions were affected. All users are encouraged to update to the latest version (tell your friends).
CE Image is a pretty amazing plugin that lets you do an extensive amount of image manipulation directly from the plugin tag. Not only can you crop and resize the image, but you can apply water marks, use filters, rotate, flip, reflect images, and a whole lot more.
Here are a couple examples of some of the cool stuff you can do: Want to make your image greyscale? Just add the parameter filter=“grayscale”. Want rounded corners? Try: rounded_corners=“all,10”. Turn your image into colorful ASCII art? Why not: ascii_art=“yes”. I’m barely scratching the surface here.
The possibilities for a plugin like this are myriad. For instance, I could see having a custom field or two in publish form to let authors upload a photo and choose which filter, size, or other parameters. Then, on the template side, you have CE Image take the results from those fields to give you customized photos on a per-entry basis.
CE Image looks very handy. Not only is it a powerful plugin but the documentation looks top notch, and the price is crazy cheap: Just $8, either from Causing Effect or Devot:ee.
The problem is that using embeds to pass content from one template to another works well enough, but it comes at a price of extra overhead to EE and plenty of potential for extra complexity for your templates.
I love the idea of using a plugin to solve this problem. John’s how-to describes an excellent way to do this and make your templates a lot easier to work with and definitely more elegant. John’s code examples are fantastic, and he walks you through the whole process very well. Plus, if you’ve ever wanted to roll your own plugin, then this is a great way to get started, too.
Rob Sanchez released a plugin for EE2 that lets you use the CodeIgniter Active Record pattern in your templates the same way you use the standard query module. The syntax is pretty dang elegant, and if you’re at all used to active record I imagine you’ll find this a welcome improvement over the query module. I’d even say if you don’t use ActiveRecord at all and want something that feels more like native ExpressionEngine template tags, you should check this out.
Our fearless leader Ryan just sent me a great tip that Lisa Wess wrote on her blog about Member Profiles:
One of my favorite new features of ExpressionEngine 2 is that the member templates are run through the full template engine. This means you can use add-on tags, channel entries tags, etc. Anything you can use in a template, you can use in your member templates.
So, someone asked if one could use nofollow links automatically in EE. Yes, you can, using the NoFollow plugin.
I love tips like these. It totally makes sense, it’s easy to implement, and it makes me wonder why this didn’t occur to me before. Check out the rest of Lisa’s post for details about how to implement it.
Today on the EE blog Pascal Kriete posted that the first party Twitter Timeline plugin now supports OAuth. This is great news because tomorrow numerous EE sites around the web using basic authentication Twitter EE add-ons are going break.
If you don’t but need to fix a site that uses another add-on, consider pulling in the RSS feed of the user’s Twitter stream and displaying using the Magpie plugin. It’s not the same and it’s not perfect, but it’s a decent stop gap measure. In fact, with a little PHP you can make it do stuff like link URLs, remove the username the prefixes every tweet and more.
:nth allows you to dynamically generate a class name at specified intervals on Expression Engine elements. Perhaps you have a list that is being dynamically populated from an EE weblog and you’d like to create a grid layout, but the last column items need to behave differently than the rest of the items. Simply wrap the whole mess in a pair of nth tags and set the class and interval parameters to your desired class name and interval.
I’ve always used some PHP in the template for situations like that (and these situations happen frequently) but this seems like a nice way for non-PHP coders to achieve the same functionality in a straight-forward way or even for PHP coders who want to limit the amount of PHP they have to write in their templates.
Wouter Vervloet posted a new plugin to the forums this week for ExpressionEngine 2: Timetravel. It “makes navigating through entries by day, month or year a breeze. It behaves similar to the default pagination, except that it uses dates in the URL instead of page numbers.”
Timetravel lets you flip through site content by date and appends the month, day and year to the URL. Wouter has a nice write-up on the forums with some example code or you can jump right to GitHub and download the plugin for yourself.
Max Lazar of WiseUp Studio has released another add-on. This time it’s MX QR Code, which allows you to easily create QR codes right in your EE templates. What is a QR code?
A QR Code is a matrix code (or two-dimensional bar code) created by Japanese corporation Denso-Wave in 1994. The “QR” is derived from “Quick Response”, as the creator intended the code to allow its contents to be decoded at high speed.
QR Codes are common in Japan, where they are currently the most popular type of two dimensional codes. Moreover, most current Japanese mobile phones can read this code with their camera.
MX QR code is free and available for both EE 1.6 and EE 2.
Copyright 2014 Mijingo, LLC and the authors. All Rights Reserved (including the best parking spot at the office). Please do not reuse this content without authorization, including full content syndication via the RSS feed. If you do, somewhere, a clown will cry.
EE Insider and its owner Mijingo, LLC are not affiliated with EllisLab, Inc., makers of ExpressionEngine. The ExpressionEngine name is a trademark of EllisLab, Inc.