ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

New EE2 plugin: URL Encode

July 16, 2010 1:48pm

Subscribe [6]
  • #1 / Jul 16, 2010 1:48pm

    Airtype Studio

    14 posts

    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]

  • #2 / Aug 04, 2010 7:33pm

    Hop Studios

    509 posts

    Hi there.

    Do you have a place we can download it from?

    TTFN
    Travis

  • #3 / Aug 09, 2010 7:02am

    ipixel (Australia)

    158 posts

    Is this available for 1.6.x?

  • #4 / Jan 11, 2011 11:45am

    Spark Creative

    28 posts

    Hey there,

    I am using your lovely plug-in on a site and am having a small issue. All of my blog posts show the same number with the Like button. I doubt that is accurate. 😊

    Also, on the feed in Facebook, the URL is incorrect. It just goes to the home page of the site I am working on.

    Any ideas on why this may be happening?

    The website is here: http://corecubed.com/blog - You will notice that all links say they have 43 (or 42 as I am testing) likes. When you click on the like button, the feed on Facebook only shows a link back to the home page. Weird right?

    I am using almost the exact code you outlined here:

    <!-- Facebook Like Button -->
    <iframe src="http://www.facebook.com/plugins/like.php?href={exp:url_encode}{title_permalink=blog/entry}{/exp:url_encode}&layout=button_count&show_faces=false&width=110&action=like&font=lucida+grande&colorscheme=light&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:21px; margin:0 15px 0 0;" allowTransparency="true"></iframe>

    Any help would be greatly appreciated. I can’t seem to see what the problem is stemming from.

    Thanks in advance! -Danielle

  • #5 / Jul 07, 2011 4:33am

    Hi guys,

    I’m trying to get a Like button on my pages, but can’t seem to get it working. It works if I place the code on my main index page like here http://boelskifte.net/index.php and use:

    {title_permalink="blog/index"}

    But when I place it on my pages with the whole article text, witch is a template called “comments” like for example this entry http://boelskifte.net/index.php/blog/comments/ipad_erstatter_piloternes_manualer and change the title_permalink accordingly like so…

    {title_permalink="blog/comments"}

    ...the Like button won’t work. On my index page it sends the “Like” to my facebook page, but not on my “comments” sub-pages. The only variable I changed, is the title_permalink.

    When looking at the rendered code, it renders the link fine on the index-page, but on the comments pages it renders it like so:

    <iframe src="http://www.facebook.com/plugins/like.php?href={title_permalink="blog/comments"}&layout=button_count…

    It seems not to render the title_permalink when on the comments page. My Comment Page URL is set to http://boelskifte.net/index.php/blog/comments in Channels Preferences.

    Can anyone figure out whats going on?

  • #6 / Jul 10, 2011 4:14am

    Well, turns out I didn’t have the tag inside the {exp:entries…} tag, so it wasn’t being rendered at all 😉

    So remember that if you can’t get it to work!

    Cheers,
    Thomas

  • #7 / Nov 14, 2011 1:40pm

    outline4

    271 posts

    thanks for this plugin…

    I’m in a situation where I have to encode in base64…
    it would be nice if you could add a parameter base64=“yes” or something similar, to mimic the php function
    base64_encode..

    well - just if you happen to have time :D
    cheers
    stefan

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases