Not sure how useful this ExpressionEngine Plug-in will be to others out there but we’re using it here at Nine Four on the Wired In website to link from an IFrame back to the parent window. This is something you would usually achieve with:
<a href="http://www.nathanpitman.com" target="_top">My Link Text</a>
…but that’s not valid XHTML so instead we need to do:
<a href="http://www.nathanpitman.com" onClick="top.location=this.href; return false">My Link Text</a>
The ‘Link Target’ plug-in just helps to keep your template code clean by writing all the JavaScript for you. Typical usage of the plug-in is as follows:
{exp:np_linktarget url="http://www.nathanpitman.com" target='top'}My Link Text{/exp:np_linktarget}
By default you have to specify a ‘url’ and ‘target’ parameter and the plug-in also optionally accepts a link ‘title’ and ‘class’. Possible ‘type’ values are ‘top’ and ‘blank’. Each mimic the link target attributes ‘_top’ and ‘_blank’ respectively.
Whilst working on the Wired In website I came up against a little problem. I wanted to be ale to show if a specific user was online or offline, much like you would on a social networking site. However although there are tags to return a list of online users within ExpressionEngine, you cannot pass this a specific username with a view to returning a true/false response.
So, after poking around a few plug-ins which queried the DB for values (specifically the ‘“Member Info”:http://expressionengine.com/downloads/details/member_info/’ plug-in) I decided to launch in and write my first plug-in to do the job for me.
The plug-in is called ‘Member Online?‘ and it accepts a ‘username’ for which it will then simply return a true or false value. Using the optional ‘return’ parameter you can specify the values you would like returned in place of true or false.
You could either use this to simply write a string out into the page, as I am, or use it to change the class of a page element to highlight online users perhaps.
At the moment I’m using this alongside the Solspace ‘“User Module”:http://www.solspace.com/software/detail/user/’ to build the community aspects of the Wired In website so I’ve only developed it so far as required to meet those requirements. If you have any further ideas as to how the plug-in could be developed do let me know. :)
Don’t get me wrong, I love Expression Engine but sometimes you just come up against a brick wall and the only solution is to either pay someone to write a very clever extension or hack the system files about yourself (not for the faint hearted!).
During a recent project I needed to implement some basic member functionality and add some custom profile fields for the member accounts. No problem, Expression Engine has this covered. But (You knew there was going to be a but) it only provides support for text input, text area and select field types. Boo!
I ‘needed’ to be able to present users with a greater variety of input types such as checkboxes and radio buttons.
So, with a little help from the fanatical EllisLab staff I set about ‘hacking’ that very feature into the product.
After my recent rant about having to edit CMS templates via a browser text field I think I have perhaps stumbled across Expression Engines best feature yet. It is for sure going to save my sanity.
Get the low-down on how to use the ‘Save Template as File’ feature right here. In the Manual no less, I know… RTFM!