Sticky header shows up in block images

Hi,

The block images generated in Litium backoffice all include the header (position: sticky), how can I prevent the header to show up in every block image?

Litium version: 8.0.0

Is it only on global blocks or local blocks too?

@ton.nguyen its for both global and local blocks

Something that you can hide if the request is in administration?

Yes, I guess, but that would also hide it in the backoffice preview? Is it possible to only target the screenshot capture?

Maybe the stickiness could be conditional on IsInAdministration? So the header would show, but not be sticky.

Another option might be to remove the element dynamically in the JavaScript that takes the screenshot. This change is done manually in the NodeServices folder and would be overwritten with each new release of Litium though.

if (request.request.blocks) {
	const header = await page.evaluate(() => {
		let element = document.querySelector("header");
		element.parentNode.removeChild(element);
	})
	
	for (const blockId of request.request.blocks) {
		const elementHandle = await page.$(`[data-litium-block-id="${blockId}"]`);
		...

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.