How can I detect in the template, if the current site is set as the homepage?
Asked
Active
Viewed 3,473 times
1 Answers
24
-
Note that if you want to access this in the menu template you have to do: {{ child.attr.is_home }} – Jonathan Liuti Oct 24 '12 at 08:46
-
1We really could use some documentation on this besides the source code. – Nostalg.io Oct 02 '14 at 00:51
-
What if I want to check that in a view or in context_processor? – jobima Feb 12 '16 at 09:43
-
In my base.html template the page is `self`, but `self.is_home`does not work – Andy Sep 23 '16 at 09:22
-
I have tried the options here, it did not work. I just added an item to the context of the home page. context['it_is_home'] = True. Then I check {% if it_is_home %}. – Abdullah Nov 07 '21 at 08:56