Re: Is there a way to use the Cut Filter to only do the first instance?

2008-10-31 Thread Jeff FW
If you know the length of the string that you want to cut off the beginning, you could use slice: http://docs.djangoproject.com/en/dev/ref/templates/builtins/#slice Really, though, you might be going about this in a strange way. It might be better to use the url tag to get the correct URL that

Re: Is there a way to use the Cut Filter to only do the first instance?

2008-10-31 Thread Karen Tracey
On Fri, Oct 31, 2008 at 11:55 AM, Frank Peterson <[EMAIL PROTECTED]>wrote: > > I am using the following > {{ section.get_absolute_url|cut:"/news/" }} > on a string that is > /news/new-york-jets/news/ > > I need to remove the first /news but the CUT filter removes all > instances of it, is there a

Is there a way to use the Cut Filter to only do the first instance?

2008-10-31 Thread Frank Peterson
I am using the following {{ section.get_absolute_url|cut:"/news/" }} on a string that is /news/new-york-jets/news/ I need to remove the first /news but the CUT filter removes all instances of it, is there a way for me to remove on the first "/news"?