This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Changing the navigation banner header


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]