Our first crack at add-on development.
Facebook’s Like button requires a urlencoded URL.
Rather than using PHP in our template, we built this light plugin to solve our problem.
The tag pair is simply:
{exp:url_encode}URL{/exp:url_encode}Installation:
Download and extract url_encode.zip.
Upload the url_encode folder into .system/expressionengine/third_party
The plugin is now ready to use.
Example usage:
{exp:url_encode}http://www.airtypestudio.com/{/exp:url_encode}The link will then display urlencoded. I can’t show the result in the forum because it’s automatically changing it back (decoding it), but download and read the instructions for a better example.
Here’s how we use it to drive our Facebook Like Button:
<iframe src="http://www.facebook.com/plugins/like.php?href={exp:url_encode}{title_permalink="template_group/template"}{/exp:url_encode}&layout=button_count&show_faces=false&width=200&action=like&colorscheme=light&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:200px; height:21px;"></iframe>Hope someone can find it useful. Let us know if you come up with any issues.
Marcus Hodges
Airtype Studio
http://www.airtypestudio.com/
[Mod Edit: Attachment removed. Please review the Community Guidelines]