Sunday, November 28, 2010

Re: If logged in show X, if not Y

On 11/28/2010 6:50 PM, robos85 wrote:
> Hi,
> I've read about {% if user.is_authenticated %} and m template is going
> to have the same structure, but some block will have different content
> for logged users. Additionally there will by some more buttons.
> I wondered if there's some other way to divide it.
> By no I have that plan:
> define 1 mainframe template. In it I'll include some sub-templates. In
> that sub-templates I'll make {% if user.is_authenticated %} and
> include the destination template or do the stuff.
>
> Is this plan ok?

It seems like a perfectly sensible plan to me. You will probably find
that you can define a hierarchy of templates, with the basic look and
feel provided by the top-level templates.

Sub-templates aren't always necessary.

regards
Steve
--
DjangoCon US 2011 Portland, OR: September 6-8 http://djangocon.us/

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment