Forum How do I...?

Footers

CamBoyce
I recently switched to Prince 6.0r6 from 5.1r7 in the process of doing so I lost all of my footers. The code we had is:

footer {string-set: v_footer content();}
footer {display:none;}

@bottom-right {
/* A couple of Irrelevant font edits */
content:string(v_appfooter, last);
}


with the XML looking like this:


<lessonheader id="LES1">
        <num>1</num>
        <title>Cam's Stuff</title>
        <footer>Cam's Stuff</footer>
    </lessonheader>

I've tried a bunch of alternative forms of content, I can get content to show up if I use a constant, but cannot seem to export the contents of the <footer> tag into the footer.
mikeday
The string-set says "v_footer" but the content uses "v_appfooter"...?
CamBoyce
Yeah, I know it's a little wonky. I'm trying to edit someone who wrote the code long before I got here. I've tried the following as alternatives...
content: flow(footer);
content: flow(v_footer);
content: flow(v_appfooter);
content: string(footer);
content: string(v_footer);
content: string(v_appfooter);

All of those with and without ", last" in there as well. I have to assume I'm missing something here. If I use a constant the text shows up but otherwise we get nothing. I'll include a larger section of code in case that helps at all.

@page:left
{
	/*size: a4; /* Standard 8.5 x 11 in paper */
	margin-left:72pt;
	margin-right:72pt;
	
	
	@bottom-left {
		content:counter(page);
		margin-left:-36pt;
	}
	@bottom-right {
		font-family:'Futura Lt BT';
		font-size:8pt;
		
		/*Use this code for footers in 5.1rev7
		content:string(v_appfooter, last);*/
		
		/*Use this code for footers in 6.0rev6 
DOES NOT WORK*/
		content:string(v_footer, last); 
		margin-left:225pt;
	}
}
howcome
The problem is caused by

footer { display: none }

If you, instead, set

footer { font-size: 0.01pt }

it should work.

I consider this is a bug it Prince -- it should be possible to assign the content of an element to a named string even if "display: none" is set. However, the spec isn't clear on this. I'll try to fix that.

Thanks for reporting an edge case
mikeday
Ah, good catch! :)

Prince does try to get string values from display: none elements, but there are situations when it doesn't work, particularly when the element is the last element in a block as in this situation.
CamBoyce
Sadly that didn't fix the problem. I've tried playing with the string declaration as well as the content arguments. Is there anywhere I can get some good documentation on these?
howcome