EE 2.0 Module: Oneliners

As you may know, I’m in the process of re-developing Sign-Up-Sheet.com. When it came time to start building the new website I decided to use ExpressionEngine 2.0. I have been a long time fan of EE and now that it’s running on CodeIgniter I just had to use it for this project. Content management systems are handy but I think of EE more as a website framework because you can do just about anything with it (with a little bit of PHP). In building the new Sign-Up-Sheet.com I needed a simple way of managing little chunks of content so I decided to build a custom module. The module is called Onliners and in this post I’ll give you the details on what it does and how to use it.

Features

Oneliners gives you a super simple clean interface to manage little bits of content. By “little bits of content” I’m referring to nothing more than a sentence long. Using the module you can group your content into logical groupings and then display those groups using variables in your templates. In the template you can control the order and number of records returned by the module.

Demo

Requirements

Oneliners is an ExpressionEngine module which requires ExpressionEngine 2.0.1+.

Installation

  1. Download the latest version of the Oneliners module.
  2. Extract the .zip file.
  3. Copy the Onliners folder to your /system/expressionengine/third_party directory.
  4. Open the Module Manager.
  5. Install the Oneliners module.

Usage

The control panel side is pretty self explanatory, refer to the demo video above for more details. There is only one variable pair available with this module and it is describe below:

lines

{exp:oneliners:lines group_id="1"}
<p>{line}</p>
{/exp_oneliners:lines}

Lines can be used to show all the lines belonging to the provided group ID. This variable pair has one required attribute: group_id. This attribute references the ID of the of the Onliner group you wish to display.

Order Parameter

You can specify the order in which your lines are displayed by including the optional “order” parameter:

{exp:oneliners:lines group_id="1" order="rand"}

Choices for the “order” parameter are:

Limit Parameter

You can specify the number of lines you wish to display by including the optional “limit” parameter. If this attribute is not provided then all lines for the specified group will be displayed.

{exp:oneliners:lines group_id="1" limit="3"}

Free to Use

Feel free to download this module and use it for yourself. Post a comment if you have any issues or ideas on how to improve.

Related posts:

  1. Implementing Facebook Connect (Part 3) – Accessing Data from Facebook

Code, ExpressionEngine

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments 

One Response to “EE 2.0 Module: Oneliners”

Leave Comment

(required)

(required)