View Full Version : page-template -> running headline


setzer
07-14-2009, 09:05 AM
Hello,

i'm tryin to get this page.template.thing 2 work but there must be something i won't get about it...
i want to create a running headline (hope it'S the right name for it) which is shown up all the time, at the head of every page with content. (Title and Author - 2 know in which ebook am i reading at the moment)
i looked at the EPUB Best Practice Guide and some other Tutorials but it won't work...
I don't know where to place some code-snippets and how to declarate/place the text which should be shown in the running headline.
Is there someone who has some experience with page-templates who can help me:help:
Or is there someone who understands my baaaad english :D

THX & Greetz
:thanks:

Abecedary
07-14-2009, 09:37 AM
I don't have any experience with the page-template file yet, but it is what I intended to start looking into today (assuming work doesn't get too busy). If I figure out how to do running head using it, I'll post back.

Jellby
07-14-2009, 09:47 AM
I don't have experience either but:

1. The page templates are specific for Adobe Digital Editions readers, they are not in the ePUB standard (as far as I know), and other readers will probably not support that.

2. The way to have headers in the ePUB standard is by using the "display: oeb-page-head" CSS, property. This is currently not supported by ADE, but it seems it will be at some point. Other readers usually don't support it either, but it could be possible to convince the developers to do it.

Abecedary
07-14-2009, 11:18 AM
1. The page templates are specific for Adobe Digital Editions readers, they are not in the ePUB standard (as far as I know), and other readers will probably not support that.

From what I've read so far, that does seem to be the case. It's one of the Adobe-specific extensions that they've added, and it's not in the formal spec at this point. On the surface, it seems like a decent idea since it allows the creator to specify variant layouts depending on screen/viewer size. More of a forward-thinking move on Adobe's part, but it remains to be seen how things play out, and whether it will ever be formally adopted.

nrapallo
07-14-2009, 12:19 PM
The 'oeb-page-head' and 'oeb-page-foot' CSS properties as well as 'oeb-column-number' are currently supported by the eBookwise .IMP format as noted in this thread (http://www.mobileread.com/forums/showthread.php?p=385429#post385429).

These are defined as OPS 2.0 extras/extensions that could become part of ADE's implementation of ePub based on this 2007 blog posting (http://blogs.adobe.com/digitaleditions/template.html) (near the bottom of that page). :smack: two years ago...

setzer
07-14-2009, 12:41 PM
2. The way to have headers in the ePUB standard is by using the "display: oeb-page-head" CSS, property. This is currently not supported by ADE, but it seems it will be at some point. Other readers usually don't support it either, but it could be possible to convince the developers to do it.

thanks fo replies :2thumbsup

in my oppinion ADE is supporting these things.. only the sony does not

and when i'm using display: oeb-page-head
should i have this .xpgt file included in epub ?
because i don't know how to get a connection between the template file and the content files...
everything i've tried will not work... :(

thx again

Jellby
07-14-2009, 12:53 PM
The 'oeb-page-head' and 'oeb-page-foot' CSS properties as well as 'oeb-column-number' are currently supported by the eBookwise .IMP format as noted in this thread (http://www.mobileread.com/forums/showthread.php?p=385429#post385429).

Great, now we only need it in ePUB. ;)

in my oppinion ADE is supporting these things.. only the sony does not

Last time I tried the desktop ADE, it didn't support oeb-page-header. Well, it does recognize it as a valid value, but does nothing with it, so that the header is displayed as if it were normal text.

and when i'm using display: oeb-page-head
should i have this .xpgt file included in epub ?

Hmm... the "display: oeb-page-head" goes in the CSS file, not in any .xpgt file or whatever (which I have never used). It's to be used like this:

<h1>Chapter 1</h1>

<div class="header">Chapter one, running header</div>

<p>Once upon a time...</p>

and then, in the CSS file (which can be inlined) you have:

div.header { display: oeb-page-head; }

nrapallo
07-14-2009, 01:02 PM
Great, now we only need it in ePUB. ;)

Well, this CSS property definitely is documented (I even provided actual examples) and just ready to be scooped by any ePub aware ebook reader.... :cool:

setzer
07-15-2009, 06:11 AM
thanks again :)

hum... so i think i have to use the xpgt file... because this is supported by ADE
does anyone has some experience with this page-template thing?

swr2408018
07-24-2009, 07:44 PM
I'm able to get the page-template working up to a point:
a) The books pages appear properly with a reserved space for a header
b) I can assign text to the header region
c) Said text only appears on the first page, not on subsequent pages made with the same template and page master

I can put the fragments I used to get this much working on the thread if there's interest. Does anyone know to make the text appear on all pages made from the same template?

Steve

zelda_pinwheel
07-24-2009, 10:20 PM
I'm able to get the page-template working up to a point:
a) The books pages appear properly with a reserved space for a header
b) I can assign text to the header region
c) Said text only appears on the first page, not on subsequent pages made with the same template and page master

I can put the fragments I used to get this much working on the thread if there's interest. Does anyone know to make the text appear on all pages made from the same template?

Steve

i'd be interested to see your code. i've not played with the page template at all so far but i'd like to take a look at it.

swr2408018
07-25-2009, 05:52 AM
Here's as close as I could get:

1) Create template.xpgt with this content (adapted from the ADE "best practices" code--my selection code is a little simpler):

<ade:template xmlns="http://www.w3.org/1999/xhtml"
xmlns:ade="http://ns.adobe.com/2006/ade"
xmlns:fo="http://www.w3.org/1999/XSL/Format">

<fo:layout-master-set>

<!-- list of page master definitions -->
<fo:simple-page-master master-name="header_body_and_footer">
<fo:region-before extent="1.5em"/>
<fo:region-body margin-top="1.5em" margin-bottom="1.5em"/>
<fo:region-after extent="1.5em"/>
</fo:simple-page-master>

<!-- page master selection -->
<fo:page-sequence-master>
<fo:repeatable-page-master-reference master-reference="header_body_and_footer"/>
</fo:page-sequence-master>

</fo:layout-master-set>

<ade:style>
<!-- dynamic styling rules -->
<ade:styling-rule selector=".header" display="adobe-other-region" adobe-region="xsl-region-before"/>
<ade:styling-rule selector=".footer" display="adobe-other-region" adobe-region="xsl-region-after"/>
</ade:style>

</ade:template>

2) Add the template to the manifest:

<item id="template" href="template.xpgt" media-type="application/adobe-page-template+xml" />

3) Link to the selector logic through CSS definitions in style.css:

p.header {
text-indent: 0;
text-align: center;
font-weight: bold;
}

p.footer {
text-indent: 0;
text-align: center;
font-weight: bold;
}

4) Invoke all this machinery with code in the xhtml file:

<p class="header">Jane Austen&mdash;Pride and Prejudice</p>
<p class="footer">Chapter 1</p>

<h1 style="page-break-before:auto" id="toc-anchor-Chapter-1">Chapter 1</h1>

<p>It is a truth universally acknowledged, that a single man in possession of a good fortune, must be in want of a wife.</p>

...

Here is what works:

a) All the pages in the book are created with reserved space at the top and bottom per region-before and region-after up in 1) above.

b) The first page of text generated from this code has the header and footer in those reserved spaces. Thanks to the layout in "em" terms, it all scales nicely at different reader size settings.

Here is what doesn't work:

c) No other pages will have the header and footer text. If I add the same header and footer declarations later in the text, the page output for that point in the text will also have the header and footer. However, it clearly isn't possible to scatter hundreds of these through the text to make sure that all pages end up with header and footer text!

As far as I can tell, this is exactly "by design". In the world of XSL-FO, a flow of text into any of the five regions is only intended to be presented on one page. The mechanism XSL-FO provides for recycling text from one page to the next is <fo:static-content .... />, either with fixed text, with text that contains pre-defined running values like page #, or with a marker that can be redefined at will by additional directives in the text ("running headers")

The ADE "best practices" docs and samples don't show how to add static-content elements to the XSL; these elements are supposed to occur in the scope of a <fo:page-sequence ... /> element . I've tried a number of variants for adding these elements to the template file, but most of them hung or crashed both ADE and the Sony reader software. If they ran at all, I didn't get the expected static text appearing in the header or footer space. I suspect that the XSL parser in ADE et al only supports a subset of XSL-FO.

I'm about ready to give up on this; my remaining hopes:

A) I haven't yet tried adding XSL-FO directly to the xhtml file to see if that works any better.
B) Someone with better understanding of XSL-FO may have other suggestions.
C) If anyone has seen an epub book with chapter headers, it should be easy to reverse engineer.

However, as pointed out earlier in this thread, the XSL-FO approach Adobe has provided runs against the grain of the standard. Since the best reason for switching from LRF to epub is to get something that will reliably deploy cross-platform, I'd hate to spend a lot of time ironing out the kinks here, only to have to replace them 6-12 months from now. So I'd appreciate any help or insights you or anyone else has, but I'm also hoping that anything we find is easy to swap out.

Thanks for any help!

Steve

swr2408018
07-25-2009, 05:54 AM
Looks like I got emoticons for : followed by p. Apologies! Steve

nrapallo
07-27-2009, 01:18 AM
Looks like I got emoticons for : followed by p. Apologies! Steve

Actually, you can edit your post and below the Additional Options and above the Manage Attachments button, you can checkmark the "Disable smilies in text" option.

This will disable ALL emoticons for THAT post. It's all or nothing, but is useful when posting code.

In other cases, just placing a space between the ':' and 'p' works as well AND allows other emoticons to be used.

Just a FYI!

setzer
07-27-2009, 04:53 AM
I'm able to get the page-template working up to a point:
a) The books pages appear properly with a reserved space for a header
b) I can assign text to the header region
c) Said text only appears on the first page, not on subsequent pages made with the same template and page master

I can put the fragments I used to get this much working on the thread if there's interest. Does anyone know to make the text appear on all pages made from the same template?

Steve

i got exactly the same problem.... :(