Category: ExpressionEngine
While working on a project recently I noted that ExpressionEngine uses a ‘JavaScript:history.go(-1)’ within the ‘User Message’ templates to allow you to return to the page from whence you came if you submit a form without completing all the required fields, perform a search and return no results etc.
I wanted to ‘do the right thing’ and ‘hacked’ an alternative as documented in this thread on the ExpressionEngine Forums. This hack picked up the referring page URL and passed that to the User Message template instead.
I kept a note of my hack and when I had to upgrade this particular install to the latest point release I set about re-implementing it. At this point Derek Jones helpfully pointed out that I could create an ExpressionEngine Extension to do the same job, negating the need to ‘re-implement’ the hack again and again. Thanks for the prod in the right direction Derek! Here’s my first ExpressionEngine Extension – ‘NoScript Messages’.
Download: ext.noscript_messages.php.zip
Obviously let me know in the comments if you have any thoughts on how this can be improved. Enjoy!
This week I had a rather nice email from a lady called Alice at Packt Publishing here in the UK. Packt are a publishing company specialising in IT focused books and have just published a new book last month called Building websites with ExpressionEngine 1.6.
The book, written by Leonard Murphy is aimed at ExpressionEngine beginners. Alice has been kind enough to send me a copy for review so once I’ve had a chance to read it I’ll report back and let you know my thoughts.
In the mean time why not take a look at a sample chapter.
Every time I come up against something which I once would have resorted to PHP to solve, I end up writing a little plug-in these days instead. It just feels less dirty that way…
Anyhow, this one was developed to help me out when I needed to pass a string of data from one page to another in the URL. The string in question would occasionally include a forward slash and as such the string would become split as Expression Engine interpreted it as two separate URL segments.
The ‘Encode/Decode’ plug-in takes any string of text and encodes or decodes it. Typical usage of the plug-in is as follows:
{exp:encode_decode style="base64" direction="encode"}{title}{/exp:encode_decode}
The plug-in offers ‘base64’ and ‘url’ encoding and decoding but it would be easy to add more options. For me base64 seems to work best.
Download ‘Encode/Decode’ from GitHub
Obviously let me know in the comments if you have any thoughts on how this can be improved. Enjoy!
A white box arrived today containing an ‘“ExpressionEngine Mug”:http://www.flickr.com/photos/nathanpitman/2678386600/’ from the good folks at EllisLab as a thanks for my video short on ‘“Why I Choose ExpressionEngine”:http://nathanpitman.com/journal/539/why-choose-expressionengine’.

It’s most awesome, primarily for its capacious capacity and then also for the ‘cut in’ ExpressionEngine ident. Now all I need is a matching T-Shirt and my life will be complete.
Thanks to all at EllisLab! :)
The Solspace Tag Module is a fantastic addition to ExpressionEngine but it lacks the option to ‘disable’ tags for certain weblogs (sections). Not to fear, your friend the PHP if statement is here. In ‘ext.tag.php’ at around about line 262 there is a code block called ‘Add tag tab to tab array’. Just modify those two lines as per the example below:
$weblogs = array(3,4,9,10,11);
if (!in_array($weblog_id, $weblogs)) {
$LANG->fetch_language_file('tag');
$publish_tabs['tag'] = $LANG->line('tags');
}
Obviously the ‘weblogs’ array is an array of weblog id’s that you do not want the ‘tag tab’ to be displayed for. You could do this round the other way, writing an array of weblogs that should include the tag tab but I felt this was the better option in my scenario.