launchpad-dev team mailing list archive
-
launchpad-dev team
-
Mailing list archive
-
Message #00913
Re: Headings and page titles
On Sep 1, 2009, at 3:00 PM, Barry Warsaw wrote:
I'm working on bug 417089 to fix this and when I know enough I will
update the page with the specific coding guidelines you'll need to
follow. For now, just do the best you can, but don't add extra
cruft to your pages to try to fix them, because that cruft will
likely have to be removed once 417089 lands.
This branch has now landed. Please see the rules here:
https://dev.launchpad.net/VersionThreeDotO/UI/Conversion#Heading%20rules
for what you need to change in your templates and views. For the link
averse:
* You will almost never need to add an H1 to your heading slot. In
fact, you should never need to fill your heading slot. If you do, let
[[mailto:barry@xxxxxxxxxxxxx|me]] know!
* If your page is the index page for your content object, have your
view class implement the marker interface
`lp.app.interfaces.headings.IMajorHeadingView`. This will put the
root context title in an H1 above the app tabs. Do ''not'' implement
a `label` attribute in your view since that will add an app-colored H1
tag below the tabs, which you don't want.
* If your page is not the index page for your root context object,
do nothing special. This will put the root context title in an H2
above the app tabs.
* If your page is an index page and you want to allow for editing of
the context title, have your view class implement
`lp.app.interfaces.IEditContextTitle` instead of `IMajorHeadingView`.
You will need to implement the `title_edit_widget` method, probably
from the appropriate lazr-js widget, which will return the entire HTML
(including the H1 wrapping) when called.
* Implement a `label` property in your view class for the H1 below
the app tabs in `LaunchpadView` subclasses. This same property will
be used as the form header in `LaunchpadFormView` subclasses.
* If for some reason you do not want to use the default reversed-
breadcrumbs in your <title>, implement the `page_title` attribute in
your view, and set the view class attribute
`override_title_breadcrumbs` to `True`. Generally, you will ''not''
want to do this, so that the default reverse-breadcrumbs are used.
You should take the time to convert any `pagetitle.py` entries for
your view to using a `page_title` attribute.
* If your page template uses `CONTEXTS/fmt:pagetitle`, get rid of
this. Use the `base-layout.pt` and it will handle your page title for
you.
Ping me on irc if any of the above rules are confusing or wrong.
-Barry
Attachment:
PGP.sig
Description: This is a digitally signed message part
Follow ups
References