Single page exhibit

I needed to output all my exhibit content onto a single page for a recent project and figured I'd share in case anyone needs such a thing.

Basically, you can add something like this to your existing template at [your-theme]/exhibit-builder/exhibits/summary.php (if you don't already have this file, create one by copying from the exhibit builder plugin at ExhibitBuilder/views/public/exhibits/):

<?php
set_exhibit_pages_for_loop_by_exhibit();
foreach (loop('exhibit_page') as $exhibitPage){

	echo '<h2>'.metadata('exhibit_page', 'title').'</h2>';
	exhibit_builder_render_exhibit_page();

    foreach (exhibit_builder_child_pages($exhibitPage) as $child) {
		echo '<h3>'.$child->title.'</h3>';
		$entries= count($child->ExhibitPageEntry);
		for($i = 1; $i <= $entries; $i++){
			$text= ($t=exhibit_builder_page_text($i,$child)) ? '<p>'.$t.'</p>' : null;
			$file= ($f=exhibit_builder_page_attachment($i, 0, $child)) ? '<div class="page-attachment">'.exhibit_builder_attachment_markup($f).'</div>' : null;

			if($file || $text){
				echo '<div class="section-container">'.$file.$text.'</div>';
				}
		}
    }

}
?>

May not be the most elegant, but it gets the job done. And you could easily modify to suit your own project requirements.

Thanks! Curious about how this handles the default navigation that shows up. Do you maintain the links to individual pages?

The default nav - via exhibit_builder_page_summary() - still functions, though I'm keeping it hidden since it seems potentially confusing to have links to pages whose content is already displayed. For a minute I was linking the page titles/section headers as links to the original page as a replacement for the nav menu, but decided against that as well.

If I were going to keep this around for a while, I'd probably do something fancier to maintain the original page layouts, etc, but this particular use is short term and the end results will be exported to PDFs (by no fancier means that printing the page as a PDF via the browser and a print stylesheet).