Conditionally display templates for different sections in Exhibit Builder?

Hi,

Does anyone have any recommendations on how to conditionally display templates for different sections in Exhibit Builder? I'm working within show.php and figure that a bit of PHP would accomplish this, although I'm a novice at the PHP part.

For instance, I'd like to do something like, "If the slug/section is 'this', then display this, else if the slug/section is ''that,' display that.

Any help would be appreciated to accomplish this!

It's a little messy, but this should get at the data you need to check. There might be more elegant ways to do it.

First, add this snippet somewhere near the top of show.php

<?php

$request = Omeka_Context::getInstance()->getFrontController()->getRequest();
$exhibit_slug = $request->getParam('slug');
$section_slug = $request->getParam('section_slug');
$page_slug = $request->getParam('page_slug');

?>

That will usually get you the slugs you want to check against from the URL. However, for some of the URL paths that exhibit builder creates, there could be different params. You can use

$params = $request->getParams();

To check for what params exist. $params there will be a keyed array.

HTH

That works great! Thank you!

Great!