List Info

Thread: Template




Template
user name
2006-02-25 12:32:24
i need to say in the template this but i don't know how:
i want to say if page.title =menu so the output will be
page.content
as i need to retreive from the database the content of the
page that has
title called menu and this is in my template
can anyone help


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Template
user name
2006-02-25 15:50:35
It would be easier to give advice if we could see the whole
story and
not only details. Could you express in clear terms what you
are trying
to achieve?

But to get started:

To test if page.title == "menu":
{% ifequal page.title "menu" %} <do something
here> {% endifequal %}

To retrieve objects from the database, you could write a
custom
template tag. But to keep things clear, it's best to
retrieve and
prepare data already in the view, unless there's a really
good reason
to do it at the template level.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )