Adding a new tab. Confused by documentation

13 views
Skip to first unread message

PlanetUnknown

unread,
Feb 9, 2011, 3:00:25 PM2/9/11
to Pinax Users
Just cloned the basic_project and trying to customize by following
this - http://pinaxproject.com/docs/0.7/tabs/#ref-tabs

Created a new app "myapp", added the new tab to the right_nav and
edited the "site_tabs.css" as well.
However when I click on the tab, although the page does change to
myapp, the background color of the tab doesn't change.

This line in the documentation - "Create a myapps/base.html template
that all pages under that tab will extend. Make sure it defines a
block body_class with content myapp" is confusing me.

What is that "body_class" mentioned ? The code of the myapp page is
pretty simple right now -


{% extends "site_base.html" %}

{% load i18n %}
{% load ifsetting_tag %}

{% block head_title %}{% trans "Custom App page" %}{% endblock %}

<div class="myapp">
<h1>{% trans "Custom App page" %}</h1>
{% if user.is_authenticated %}
<p>You are signed in !!</p>
{% else %}
<p>You are NOT signed in !!</p>
{% endif %}
</div>


Any pointers would be great. Thanks.

Daniel Greenfeld

unread,
Feb 9, 2011, 3:15:25 PM2/9/11
to pinax...@googlegroups.com
I would switch from 0.7 and go right to the 0.9a version. I've seen it
used in many production applications and it is what powers
djangopackages.com.

There, the tabs thing is just plain easier:
http://pinaxproject.com/docs/dev/tabs/#ref-tabs

Danny

> --
> You received this message because you are subscribed to the Google Groups "Pinax Users" group.
> To post to this group, send email to pinax...@googlegroups.com.
> To unsubscribe from this group, send email to pinax-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pinax-users?hl=en.
>
>

--
'Knowledge is Power'
Daniel Greenfeld
http://pydanny.com
http://cartwheelweb.com

PlanetUnknown

unread,
Feb 9, 2011, 3:23:39 PM2/9/11
to Pinax Users
Thanks Danny,
But again, this sentence is not clear - "Make sure it defines a
block body_class with content myapp"
Does it mean I have to have a "<DIV>" tag with "class" defined as
below -
<DIV class="{%block body_class%}{%endblock%}">
And even if that is correct, what is "with content myapp" ?


On Feb 9, 3:15 pm, Daniel Greenfeld <pyda...@gmail.com> wrote:
> I would switch from 0.7 and go right to the 0.9a version. I've seen it
> used in many production applications and it is what powers
> djangopackages.com.
>
> There, the tabs thing is just plain easier:http://pinaxproject.com/docs/dev/tabs/#ref-tabs
>
> Danny
>
> On Wed, Feb 9, 2011 at 12:00 PM, PlanetUnknown
>
>
>
>
>
>
>
>
>
> <nikhil.kodil...@gmail.com> wrote:
> > Just cloned the basic_project and trying to customize by following
> > this -http://pinaxproject.com/docs/0.7/tabs/#ref-tabs
> > For more options, visit this group athttp://groups.google.com/group/pinax-users?hl=en.

Daniel Greenfeld

unread,
Feb 9, 2011, 3:29:41 PM2/9/11
to pinax...@googlegroups.com
If memory serves, it means:

<DIV class="{%block body_class%}blarg{%endblock%}">

Where 'blarg' == 'myapp'.

Hope that helps!

> For more options, visit this group at http://groups.google.com/group/pinax-users?hl=en.
>
>

--
'Knowledge is Power'

PlanetUnknown

unread,
Feb 9, 2011, 3:38:56 PM2/9/11
to Pinax Users
Thanks. That worked.

PlanetUnknown

unread,
Feb 9, 2011, 3:57:56 PM2/9/11
to Pinax Users
Actually I did this, which is pretty close to what you suggested -
{% block body_class %}myapp{% endblock %}
Thanks again.
Reply all
Reply to author
Forward
0 new messages