This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: Changing the navigation banner header
- To: docbook-apps at lists dot oasis-open dot org
- Subject: Re: DOCBOOK-APPS: Changing the navigation banner header
- From: Bob McIlvride <robert at cogent dot ca>
- Date: Mon, 28 Aug 2000 09:35:35 -0400
- References: <39A298F8.CE7DB35B@cogent.ca> <87bsyi6atl.fsf@nwalsh.com>
Norman Walsh wrote:
> Sure, override (define (nav-banner elemnode)) to do what you want.
Here's what we came up with. Perhaps others might like to use it...
From the html/dbnav.dsl stylesheet, copy to your custom stylesheet:
...................................................................
(define (nav-banner elemnode)
(let* ((rootelem (sgml-root-element))
(info (info-element rootelem))
(subtitle-child (select-elements (children rootelem)
(normalize "subtitle")))
(subtitle-info (select-elements (children info)
(normalize "subtitle")))
(subtitle (if (node-list-empty? subtitle-info)
subtitle-child
subtitle-info))
(banner-text (inherited-dbhtml-value elemnode
"banner-text"))
(banner-href (inherited-dbhtml-value elemnode
"banner-href"))
(banner (if (and banner-text (not (string=? banner-text
"")))
(literal banner-text)
(make sequence
(element-title-sosofo rootelem)
(if (node-list-empty? subtitle)
(empty-sosofo)
(make sequence
(literal ": ")
(with-mode subtitle-mode
(process-node-list
subtitle))))))))
(make sequence
(if banner-href
(make element gi: "A"
attributes: (list (list "HREF" banner-href))
banner)
banner))))
.........................................................................
2. Change the line:
(let* ((rootelem (sgml-root-element))
to:
(let* ((rootelem (ancestor-member (current-node)
(list(normalize "book"))))
What this does is instead of putting the root element (Set) at the top
of the navigation banner for every page, it puts the book ancestor of
the current node (Book). This way you get the book title and subtitle
for each book you are in.
---
Bob