Page 1 of 1
Custom footer
Posted: Fri Mar 28, 2025 10:10 am
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
Re: Custom footer
Posted: Fri Mar 28, 2025 12:45 pm
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
Re: Custom footer
Posted: Fri Mar 28, 2025 1:47 pm
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
Re: Custom footer
Posted: Mon Mar 31, 2025 11:06 am
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