Another day, another little ExpressionEngine Plug-in. I needed to return a list of UK counties in a standalone entry form. I could have simply flicked on PHP for the template and spewed forth a foreach from an array but I thought I’d wrap it all up in a plug-in instead, so here it is.
The ‘UK Counties Select’ plug-in simply renders a drop down select form element with an alphabetical list of UK counties. Usage of the plug-in is as follows:
{exp:np_uk_counties_select name="counties"}
I could add options to specify a class, id etc but for now this does the job just fine for me.
Download: pi.np_uk_counties_select.php.zip
Obviously let me know in the comments if you have any thoughts on how this can be improved. Enjoy!
ExpressionEngine does not provide a ‘native’ facility for recording links but the immense flexibility of ExpressionEngine Weblogs allows you to create your own links facility by just creating a new Weblog with the relevant custom fields (Title, URL & Description) and then setting up a related category group.
Just as we exported our article data from Textpattern we ‘could’ also export our Link data and then use the same import process to pull it into ExpressionEngine.
However this is not the route I’m going to take. Personally I would much rather maintain my ‘noteworthy’ links using a tool like ‘Delicious’ so I’m going to show you how we can migrate our Textpattern links to Delicious and then have them displayed inline within an ExpressionEngine template.
Luckily for us there’s a fantastic Textpattern Extension called ‘ajw_bookmarks’ that provides us with a quick and easy way to export our Links to a ‘Bookmarks’ file which most bookmark services and browsers can import.
Download and install the Extension within Textpattern and then navigate to the Bookmarks tab within Extensions and select the first option ‘Export bookmarks’.
Now that we have our locally saved Bookmarks file navigate to the ‘Import Bookmarks’ tool on the Delicious website (obviously you will need to log-in first) and then choose the ‘Custom import’ option.
Now we want our bookmarks to be visible to the public so check ‘make all my imported bookmarks public’. If you wish to use Delicious to record bookmarks for personal use and also for display on your website you may want to tag all the bookmarks you are going to import with a keyword such as ‘noteworthy’ or similar. This is the approach I took. By adding this tag I can identify which bookmarks should be pulled out of Delicious for display on my website. Now click ‘Import Now’.
Delicious should have a bit of a think, depending on the size of your links collection and then display your imported bookmarks.
We’re going to use the ExpressionEngine ‘Magpie’ plug-in to pull our Delicious links into our template and display them inline. The plug-in will also cache the data so if Delicious should go down our site won’t fall apart. The Magpie plug-in is a part of the default ExpressionEngine install so just open up a template file and drop in the following code:
{exp:magpie url="http://feeds.delicious.com/v2/rss/nathanpitman?count=10&tag=noteworthy" limit="10" refresh="60"}
<ul>
{items}
<li><a href="{link}" title="{title}">{title}</a><br />
{description}</li>
{/items}
</ul>
{/exp:magpie}
Obviously you’ll have to replace ‘nathanpitman’ in the feed URL with your own Delicious username and if you want to pull back bookmarks with a particular tag then include the ‘&tag=’ parameter and variable in the querystring as I have above.
You should now have a nice unordered list displaying your 10 most recent Delicious bookmarks or my 10 most recent Delicious bookmarks if you forgot to change the username in the URL. :)
If you need to you can also tweak the number of minutes that the plug-in waits before it refreshes the feed display, I’d opt for 60 minutes. The Magpie plug-in defaults to 3 hours if you don’t specify a refresh value.
As a business (Nine Four) we have used Staples to purchase office supplies on a regular basis for the past couple of years. The last time I used the Staples website to place an order I noticed that the total for my goods was a little higher than I expected, I reviewed the basket again and noticed that a line had been added with the label ‘OrderCare’ and a small additional sum, between 2 and 3 pounds if I remember rightly.
What is ‘OrderCare’ you may wonder… here’s what Staples say on their website:
Staples OrderCare is a premium service which allows you to return unwanted items to us anytime within 12 months of purchase, for whatever reason.
and a little later on the same page:
** If you are returning unwanted items between 3 and 12 months since your order, that are not in a resaleable condition, we reserve the right to charge a minimum restocking fee of £15 or 20% of the item’s selling price.
So basically Staples are (without first asking) charging all online customers (not sure if this also applies to phone and mail orders) a small additional sum for a service which they have not opted in to and that will in 99% of cases be of zero use above and beyond what is already offered in the basic returns service.
Now consider that I’m a scrooge and that as the business owner I look for every opportunity possible to reduce costs where suitable. In the vast majority of cases the individual ordering stationary will be an employee who does not really care if they are charged an additional small nominal sum (how do they calculate it!).
Add to all of the above that there is no way to have ‘OrderCare’ default to off on your account, you have to turn it off every time you make an order and this involves navigating to a pop-up window and checking a box to opt out rather than just giving the user the check box on the basket screen itself.
Imagine how much cash Staples are making every day out of businesses that are totally unaware of the fact that they are paying an additional charge for something they did not ask for.
I’ve taken our business elsewhere, perhaps you should do the same. Viking Direct also offer a similar ‘extended warranty’ service but as you would expect, it defaults to off and can be set at an account level. Good job.
For designers and developers.
Want to advertise a vacancy, email hello@nathanpitman.com.
A selection of noteworthy sites, articles or neat 'stuff'.
People keep asking, where did all your Fireworks Extensions go? They've been on holiday for quite some time, but with renewed enthusiasm for Fireworks mounting, they're back.
Involved in interactive design and development since 1995. Nathan now runs his own digital media agency called ‘Nine Four’. This is Nathan’s personal creative journal. More…
Subscribe to: