How to Show Metadata in the Cover PageEdit online
Suppose you need to present the author and the ISBN just under the
publication title. Your bookmap
contains:
<bookmap id="taskbook"> <booktitle> <booklibrary>Retro Tools</booklibrary> <mainbooktitle>Product tasks</mainbooktitle> <booktitlealt>Tasks and what they can do</booktitlealt> </booktitle> <bookmeta> <author>Howe Tuduit</author> <critdates> <created date="1/1/2015"/> <revised modified="3/4/2016"/> <revised modified="3/5/2016"/> </critdates> <bookid> <isbn>071271271X</isbn> <booknumber>SG99-9999-00</booknumber> ...
The entire <booktitle> element content is displayed on the first
page of the PDF, so suppose you need to add the information after it.
In your customization css, add the
following CSS
rules:
*[class ~= "bookmap/booktitle"]:after { display:block; content: "by " oxy_xpath('//*[contains(@class, " bookmap/bookmeta ")]/*[contains(@class, " topic/author ")]/text()'); margin-top: 4em; text-align: center; color: gray; } *[class ~= "bookmap/booktitle"]:after(2) { display:block; content: "ISBN "oxy_xpath('//*[contains(@class, " bookmap/isbn ")]/text()'); text-align: center; color: gray; }
The following CSS extensions were used in this example:
- oxy_xpath - Executes an XPath expression and returns a string content.
:after(N)- Creates more than one after pseudo element. The argument value represents how far the generated content is from the real content. In the example above, the content of the:afteris closer to the title (upper) than the content of the:after(2).
Generating Synthetic Pages for Metadata.
Suppose you need to show this information on a page that follows the title page, instead of on the title page. In this case, you need to prepare a named page and place the content on it. In your customization css, add the following CSS rules:
@page page-for-meta { background-color: yellow; /* Just to see it better*/ @top-left-corner { content:""; /* Remove the default header */ } @top-right-corner { content:""; /* Remove the default header */ } } *[class ~= "bookmap/booktitle"]:after { page: page-for-meta; } *[class ~= "bookmap/booktitle"]:after(2) { page: page-for-meta; }