djangosnippets.org: Latest snippets tagged with 'simple_tag'https://djangosnippets.org/tags/simple_tag/2012-06-19T08:30:37-05:00split in html template2012-06-19T08:30:37-05:00musluhttps://djangosnippets.org/snippets/2772/<p>Html içinde split ile kesme</p>
<p>Kesme işleminden sonra kaçıncı bloğun okunacağını düzeltebilme</p>
<p>{% kes request.path "/" 3 4 %}</p>
<p>gelenveri.split("/")[3:4]</p>
Freely redistributablea simple tag with context2009-12-21T17:48:26-06:00dsblankhttps://djangosnippets.org/snippets/1839/<p>simple_tag is nice, but it would be useful if it had a "as variable" clause at the end. This little bit of code factors out the reusable parts and makes a tag almost as simple as simple_tag. Now you can create tags like the following:</p>
<pre><code>{% some_function 1 2 as variable ...</code></pre>
Freely redistributableFull Featured Gravatar Tag2008-12-13T22:50:36-06:00ashcrowhttps://djangosnippets.org/snippets/1247/<p>Simply returns a created gravatar url based on input. Creates the url utilizing the full gravatar url inputs as defined at http://en.gravatar.com/site/implement/url.</p>
Freely redistributabletwitter_status2008-08-31T03:32:48-05:00zodmanhttps://djangosnippets.org/snippets/1013/<p>Ah simple_tag for get last update of twitter. How twitter limit the fetch rss so, add cache tag for each 30min ( 60*30) update the twitter. if.</p>
Freely redistributableSlightly better media path tag2007-04-23T15:40:48-05:00ubernostrumhttps://djangosnippets.org/snippets/198/<p>A slightly improved version of <a href="/snippets/195/">snippet #195</a> which keeps the logic but makes use of the <code>simple_tag</code> decorator to drastically simplify the code.</p>
<p>For an alternative to this sort of tag, check out the media context processor in my <a href="http://code.google.com/p/django-template-utils/">template_utils app</a>.</p>
Freely redistributable