On Sat, Oct 3, 2009 at 4:01 PM, Andrew <andriu...@gmail.com> wrote:
>
> Anyway, I thound that's not possible, so I will need to create
> specific custom tag for this.
>
> On Oct 3, 2:07 pm, Andrew <andriu...@gmail.com> wrote:
>> Hello,
>>
>> is there any way to use custom template tag inside {if} or ifequal
>> tag?
>>
>> I have custom tag "getpreference" which accepts one parameter and
>> returns string value or empty "" string.
>> I want to check if value is not empty inside {if} or maybe {ifequal}
>> tag, how do I do that?
>>
>> {% if getpreference "left_position" %}
>>   <div class="left">
>> {% else %}
>>   <div class="right">
>> {% endif %}

custom tag is a function  - cant you just assing its return in view
into variable and send this variable to template?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to