Content last modified Wednesday 8 February 2012
hop to #bottom
Categories:
Author:
Current version:
0.2
About It:
Get it:
Rate it:
  • Helpful?
  • 0 Yes
  • 3 No
Flag it:
Contact Reason [ ? ]

sho_urlencode

sho_urlencode is an extremely simple plugin similar to etz_striptags. It passes its argument to the php rawurlencode function and should work with all versions of Textpattern.
It was necessary to create this plugin in order to get the Facebook Like button working for me and keeping any php code from the forms.

Examples

<txp:sho_urlencode><txp:permlink /></txp:sho:urlencode>

In case the permlink looked like this:

http://example.com/1/welcome-to-your-site

it would be converted to

http%3A%2F%2Fexample.com%2F1%2Fwelcome-to-your-site

Tag reference

The following tags can be used:

  • <txp:sho_urlencode><txp:permlink /></txp:sho:urlencode>
  • <txp:sho_rawurlencode><txp:permlink /></txp:sho:rawurlencode>
  • <txp:sho_urldecode>http://example.com/search?q=term</txp:sho:urldecode> will return “http%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dterm”
  • <txp:sho_rawurldecode>foo%20bar%40baz</txp:sho:rawurldecode> will return “foo bar@baz”

History

  • v0.2 enhanced plugin to allow all urlen/decode functions (12-07-2011)
  • v0.1 initial release (11-07-2011)
Article Request Count:
Keywords/tags:
Initially released:
11-07-2011
Posted here:
11 Jul 2011
Article modified:
12 Jul 2011

If there is a comment form at the Information URL, you may want to leave your comments/questions there for quicker feedback. Otherwise, comment away:

Your comment will NOT be submitted until you click the 'Submit' button on the next pageload.

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

You know you want to visit the Archives.

Browse

Categories


Articles

There are also tag clouds, 'cause those are fun.
TxP · TxD · GG