On Sunday, July 24, 2011 5:27:12 PM UTC-4, Ramos wrote:
>
> My dificulty is the {{ include }}tag
>
> If a layout has for example 4 include tags how does the view knows where to
> put the content.
>
It doesn't, which is why you can have only one {{include}} in a view.
However, if you want to include specific views, you can always do {{include
'other_view.html'}}. Do you have an example of what you are trying to
achieve?
>
> Also the block tag is the same as the include tag?
>
Not exactly -- it serves a similar, though more specific purpose. If your
layout view includes a block with a particular name, and an extending view
includes a block with the same name, then the content of the block in the
layout will be replaced with the content of the block in the extending view.
So, blocks could be a way of achieving what you mentioned above (i.e.,
having multiple {{include}} statements) -- if you want the extending view to
insert content at multiple places within the layout view, you can do that
with several named blocks (each named block in the layout view will be
replaced with the content of the named block in the extending view). Note,
the block in the layout view can include its own default content -- so if
the extending view doesn't have a block with that name, the default content
will be displayed.
Anthony