{{ post.subject|slice:":15"|escape }} does the job.
On Aug 20, 6:55 am, patrickk <[EMAIL PROTECTED]> wrote:
> thanks.
>
> since truncatewords and truncatewords_html are predefined filters, I
> guess that truncate should also be one (just my opinion).
>
> patrick
>
> On 20 Aug., 12:33, Malcolm Tre
thanks.
since truncatewords and truncatewords_html are predefined filters, I
guess that truncate should also be one (just my opinion).
patrick
On 20 Aug., 12:33, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Mon, 2007-08-20 at 11:52 +0200, patrickk wrote:
> > how do I truncate a string (in
On Mon, 2007-08-20 at 11:52 +0200, patrickk wrote:
> how do I truncate a string (in the template) after a certain amount
> of characters?
> I know there´s a truncate-filter, but it works with words and not
> characters.
There's #5025 in Trac.
This shouldn't be seen as any endorsement for th
2007/8/20, patrickk <[EMAIL PROTECTED]>:
> how do I truncate a string (in the template) after a certain amount
> of characters?
It's not difficult to create custom filters. For example
from django.template import Library
register = Library()
@register.filter
def truncate(value, arg):
try:
how do I truncate a string (in the template) after a certain amount
of characters?
I know there´s a truncate-filter, but it works with words and not
characters.
thanks,
patrick
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Go
5 matches
Mail list logo