MIKESTOWE.COM

Just another php, religion, and politics weblog

HTMLe Plugin Engine

What is HTMLe
You’ve just built a WordPress website for your client, or provided them with a custom CMS and then they say… “we want to add a feed on this page to cnn.com, and a feed on this page to yahoo.com.”  Or they say, “wow, this is great, but can we add our twitter feed to this page only” or “can we hook this up to our store database and show products for this category on this page, and a different category on this page?”  Unfortunately, clients do not seem to realize that these are database driven sites, meaning the content is simply being pulled out of the database and thrown into a single, templated page.

It was from this lack of understanding that HTMLe, the plugin engine was built.  Similar to Smarty’s plugin engine, HTMLe allows you to build a single plugin which is called by a “smart tag” and accepts unlimited attributes.  But HTMLe takes it one step further as it allows you to call sub-functions individually, as well as use a class instead of a function… giving you even more control over your plugin and allowing for even greater code reusability.

For example, by default the RSS READER plugin is included.  To add an RSS feed to a page you would simply add { rssreader url=”http://www.mikestowe.com/feed/” posts=”5″ words=”25″ endwith=”…” }  This would then display 5 posts (with upto 25 words) from the Mikestowe.com feed.  Of course you can take even greater advantage of this “HTMLe tag” by adding the skip attribute (skips the first # of words) and the style attribute (let’s you completely style how the individual posts are displayed).


Installing HTMLe

HTMLe can be installed as a WordPress plugin or standalone on any server running PHP 5.

To install as a WordPress plugin:

  1. Install the HTMLe folder in the wp-content/plugins/ folder
  2. CHMOD the HTMLe/plugins folder and its contents to 777 to enable plugin creation and editing (this can be skipped for security purposes)
  3. Activate the plugin through the WordPress admin panel (under plugins)

To install as a stand alone plugin for a custom CMS/ DDW:

  1. Install the HTMLe folder somewhere in your site’s directory
  2. If you do not have autoload setup for this location, include the HTMLe.php file (you only need to do this once)
  3. Wrap your output code in the HTMLe function or class
    1. <?php HTMLe_process($output); ?> - OR -
    2. <?php $HTMLe = new HTMLe$HTMLe->parse($output); ?>


Coding Restrictions

  1. HTMLe tags may not contain a space between the opening bracket and the HTMLe tag (for example, { rssreader} will not work
  2. You may only use quotations when referring to attributes, and they may not be used outside of defining an attribute.  It is recommended to use apostrophes (‘) inside of an attribute when needed.  For example, { rssreader style=”<a href=”">”} will not work.  However you may also use HTMLe smart tags to do this, so in the case of =” you can use (( and in the case of ” you can use )) or { rssreader style=”<a href((%link%))>”}

Bugs

  • No known errors


Awards (Yay)
- listed in the order received
Famous Software Download

Usage
HTMLe is now being released under the GPL version 2 license. If you do find HTMLe to be useful, or have any suggestions or ideas, please let me know

Download

HTMLe  (click to download)
The plugin engine for CMS/ Database driven websites
version: 2.2.1
size: 18.45kb

http://github.com/mikestowe/HTMLe

http://www.phpclasses.org/HTMLe

http://wordpress.org/extend/plugins/htmle/

Sign up to be notified of updates | HTMLe Plugins Directory
HTMLe Documentation coming soon…

Facebook Twitter Linkedin Digg Reddit Stumbleupon Tumblr Posterous Email Snailmail
Share

One Response to “HTMLe Plugin Engine”

  • mike says:

    HTMLe is brand new, and was at first a quick solution to ongoing CMS modification requests… there is a lot that can still be improved, so any feedback would be appreciated!

    Thanks,
    Mike 8)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>