That should work.
http://docs.djangoproject.com/en/dev/ref/templates/builtins/#include


Try this:

{% extends "main.html" %}

{% block test %}
CODE: {{code}} {% include code %}
{% endblock %}


Do you see the code value in the output?


On Wed, Feb 4, 2009 at 1:51 PM, Dafidov <dafi...@gmail.com> wrote:
>
> Hello
> I have this kind of problem: In some child template I want to include
> in {% block metatags %} other file depending of which link was clicked
> on page.
> In view I'm sending as code the name of this variable and when i
> display it everything is ok - there is this data what I need under
> this code, but here starts problem - I know that I have correct data
> in this variable but when I tray to include file with this name
> variable it doesn't work.
> sample code
> in main template I have
> {% block test %}
> <meta name="description" content="{% block description %}{% trans "
> some description " %}{% endblock %}" />
> {% endblock %}
>
> in one of template I want to add this new data from file depending of
> clicked link so I do:
>
> {% extends "main.html" %}
>
> {% block test %}
> {% include code %}
> {% endblock %}
>
> But it doesn't work
> Let's say that example cods are: prod-name1 prod-name2
>
> I have in this file prod-name1 this:
> {% block test %}
> <meta name="description" content="{% block description %}{% trans "
> some other description " %}{% endblock %}" />
>
> when I'm doing it like this:
>
> {% block test %}
> {% include 'prod-name1' %}
> {% endblock %}
>
> everything work's fine...
>
> What is wrong - I think this is some kind of bug in django if it can't
> load in include files named as variable.
>
> Have anyone same problem like me ?
>
> Best regards
> >
>



-- 
------------------------------------------------------
Ales Zoulek
+420 604 332 515
Jabber: a...@jabber.cz
ICQ: 82647256
------------------------------------------------------

--~--~---------~--~----~------------~-------~--~----~
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