<p>The issue was that the custom short name I was using (in this case the development domain) was not associated with the bitly account.  Total oversight! I've removed that and it works perfectly.</p>

CC BY-SA 3.0
2016-09-22T22:18:33.973Z
Glad you got it sorted out!
Aaron Berkowitz
CC BY-SA 3.0
2016-09-22T18:25:49.390Z
2016-09-22T18:25:49.390Z
ByteMyPixel
<p>How can I use the shortener plugin to get and shorten the current URL?</p>

<p>I've tried both twig and plugin methods shown in the docs, but the twig method outputs the FULL url, and the plugin method doesn't work at all (no output).</p>

<p>Here is what I have in my template:</p>

<pre><code> {% set longUrl = craft.request.getUrl() %}
 &lt;p&gt;share link: &lt;a href="{{ longUrl|shorten }}"&gt;{{ longUrl|shorten }}&lt;/a&gt;&lt;/p&gt;
</code></pre>

<p>The result with this is the full URL.</p>

<p>My configs in the plugin settings:</p>

<p><a href="https://i.sstatic.net/NJ36L.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/NJ36L.png" alt="enter image description here"></a></p>

<p>I cleared my system cache after I updated the settings as well.</p>

<p>Any ideas what I'm missing here?</p>

CC BY-SA 3.0
2016-09-22T00:16:08.597Z
Never used the plugin, but it looks like they do some caching in https://github.com/aberkie/craft-shortener/blob/master/shortener/services/ShortenerService.php. Maybe you've got some cached bad results. Try clearing `craft/storage/runtime/cache`?
Brad Bell
CC BY-SA 3.0
2016-09-22T15:34:46.963Z
Are you getting any errors in devMode when you load the page that calls shortener?
Aaron Berkowitz
CC BY-SA 3.0
2016-09-22T15:56:53.500Z
Just tested it, no errors at all.
ByteMyPixel
CC BY-SA 3.0
2016-09-22T15:59:19.963Z
Oh!  It works when I clear the custom short domain :)
ByteMyPixel
<plugins><url><filter><variable>
How to shorten 'craft.request.getUrl()' with the shortener plugin?
# How to shorten 'craft.request.getUrl()' with the shortener plugin?

(Asked by: username_0 on 2016-09-21)

How can I use the shortener plugin to get and shorten the current URL?
I've tried both twig and plugin methods shown in the docs, but the twig method outputs the FULL url, and the plugin method doesn't work at all (no output).
Here is what I have in my template:
 {% set longUrl = craft.request.getUrl() %}
 share link: {{ longUrl|shorten }}

The result with this is the full URL.
My configs in the plugin settings:

I cleared my system cache after I updated the settings as well.
Any ideas what I'm missing here?

**Tags:** plugins, url, filter, variable

> **Comments:**
> **username_1**: Never used the plugin, but it looks like they do some caching in https://github.com/aberkie/craft-shortener/blob/master/shortener/services/ShortenerService.php. Maybe you've got some cached bad results. Try clearing `craft/storage/runtime/cache`?  
> **username_2**: Are you getting any errors in devMode when you load the page that calls shortener?  
> **username_0**: Just tested it, no errors at all.  
> **username_0**: Oh!  It works when I clear the custom short domain :)  

---

## 1 answers

### Answer by username_0 on 2016-09-22. Score: 2 | Accepted answer

The issue was that the custom short name I was using (in this case the development domain) was not associated with the bitly account. Total oversight! I've removed that and it works perfectly.

> **Comments:**
> **username_2**: Glad you got it sorted out!  

---

