Custom footer

Post here questions and problems related to editing and publishing DITA content.
natalia_carrilo
Posts: 2
Joined: Fri Mar 28, 2025 9:57 am

Custom footer

Post by natalia_carrilo »

Hi!
I have created an .xhtml footer file to be added to webhelp.fragment.footer. I would like the publication number and review to be displayed in the footer. Is there any way to extract the information from the publication map? I tried adding topicmeta and adding a new parameter in the transformation scenario, but it didn't work.

Thank you!
Natalia
julien_lacour
Posts: 665
Joined: Wed Oct 16, 2019 3:47 pm

Re: Custom footer

Post by julien_lacour »

Hello Natalia,

You can extract information from the publication map by using the map-xpath WebHelp Macro directly in the footer fragment, something like:

Code: Select all

<whc:macro value="${map-xpath(/bookmap/bookmeta//reviewed/person)}" xmlns:whc="http://www.oxygenxml.com/webhelp/components"/>
Regards,
Julien
natalia_carrilo
Posts: 2
Joined: Fri Mar 28, 2025 9:57 am

Re: Custom footer

Post by natalia_carrilo »

Hi Julien, thanks for the reply.
Actually, I created the xhtml file because I want a footer structured in two lines. It should be something like this:
Publication X - Issue X - Date X
Copyright (with link to the page)
Can I still use map-xpath? Also, since I'm working on a ditamap, should I use the topicmeta element?

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
        <title>Footer Template</title>
        <style type="text/css">
            /* Styling for the footer */
            .wh_footer {
                background-color: rgb(61, 61, 61);
                padding: 4em 0em;
                color: #ffffff;
                text-align: center;
            }</style>
    </head>
    <body>
        <!-- Footer Section -->
        <div class="wh_footer" id="custom-footer">
            <div>
                <!-- Display Publication Number -->
                <p>Publication: X - Iss 0 - Date: 26-03-2025</p>
                <p>© "Company name". All rights reserved. | <a
                        href="${path(oxygen-webhelp-output-dir)}/c_copyright.html">Copyright</a></p>
            </div>
        </div>
    </body>
</html>
Thank you in advance!
Natalia
julien_lacour
Posts: 665
Joined: Wed Oct 16, 2019 3:47 pm

Re: Custom footer

Post by julien_lacour »

Hello Natalia,

Of course you can use map-xpath in a ditamap, you can have this for example:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
    <title>Footer Template</title>
    <style type="text/css">
      /* Styling for the footer */
      .wh_footer {
        background-color: rgb(61, 61, 61);
        padding: 4em 0em;
        color: #ffffff;
        text-align: center;
      }</style>
  </head>
  <body>
    <!-- Footer Section -->
    <div class="wh_footer" id="custom-footer">
      <div>
        <!-- Display Publication Number -->
        <p>Publication: <whc:macro value="${map-xpath(/map/topicmeta/author)}" xmlns:whc="http://www.oxygenxml.com/webhelp/components"/> 
          - Iss 0
          - Date: <whc:macro value="${map-xpath(/map/topicmeta/critdates/revised/@modified)}" xmlns:whc="http://www.oxygenxml.com/webhelp/components"/></p>
        <p>© "Company name". All rights reserved. | <a href="${path(oxygen-webhelp-output-dir)}/c_copyright.html">Copyright</a></p>
      </div>
    </div>
  </body>
</html>
Regards,
Julien
Post Reply