Forum How do I...?

A few (more) questions about flow

gt
Hello.

I am using named flows to put HTML content into the margins. It works well but I have a few questions.

Here is the structure of my HTML and CSS:

@page {
	@top-left {
		content: flow(in_pdf_top_left);
	}
	@top-right {
		content: flow(in_pdf_top_right);
	}
}


h1 {
	string-set: texth1 content();
}

.in_pdftext_h1 {
	content: string(texth1);
}

.in_pdftext_pagenum {
	content: counter(page);
}

#in_pdf_top_right {
	flow: static(in_pdf_top_right);
}
#in_pdf_top_left {
	flow: static(in_pdf_top_left);
}

...

<div id='in_pdf_top_left'><p>You are reading: <span class='in_pdftext_h1'></span>&nbsp;</p></div>
<div id='in_pdf_top_right'><p>Page: <span class='in_pdftext_pagenum'></span>&nbsp;</p></div>

...


Now, the page counter in the top-right margin box works a treat, but the string content update for the H1 header name only works if the in_pdf_top_left div appears AFTER the H1, and even then it is not updated after a new H1.

If I remove the indirection div and place the content directly into @top-left margin box then that works OK, but obviously there are restrictions on how I can style that content, which is why I'm trying to use the extra div and named flows.

Is there any other way I can do this?

Thanks for your help.

Regards,
Gary.
mikeday
This looks like a limitation in the way that Prince handles string-set and flowing content into the margin boxes; unlike the page counter the string value appears to be substituted once, rather than updated on every page. Hopefully we can address this limitation in a future release of Prince. In the meantime, I think the only option is to place the string into a margin box using generated content. This does limit the styling options, but other margin boxes can still contain content flowed from the document.
gt
OK. Thanks for the confirmation Mike.

Regards,
Gary.
pkj
Hi Mike,

When I discovered that the page counter worked in this context, I assumed that the other substitutions would work as well, so that's quite a disappointment to us. Well, we all know the saying about assuming things.

Do you have any thoughts about what level of priority you will give to this?

Regards

Peter
mikeday
We've taken a look at this issue, and I'm happy to say that we will be able to remove this limitation in the next maintenance release of Prince, due out shortly.
gt
Excellent! Thanks for looking into this Mike. We'll keep a look out for the maint release.

Ta,
Gary (and Peter)
mikeday
Today we have released Prince 6.0 rev 7, which fixes the issue with named strings not being updated on subsequent pages.