What is the best way to modify my Omeka 2.0 theme so that when someone clicks on an exhibit title from the "Browse Exhibits" page, it goes directly to the first page of that exhibit, rather than the default Summary page?
We have an older (1.5ish)version of Omeka that was modified to do just that, but I can't seem to figure out how my predecessor did it.
exhibit_builder_exhibit_uri function in helpers/ExhibitFunctions.php determines what the "default" link to an exhibit is (it's the section right under the comment "If there is no page slug...").
You'd have to replace the line
$uri = public_url(array( ... with a somewhat bigger block of code:
$topPages = $exhibit->getTopPages();
$uri = exhibit_builder_exhibit_uri($exhibit, $topPages);
That replaces the "summary" default by calling back to the same URI function, but giving it the first "top" page.
That's all modifying the plugin. If you want to do it in the theme alone, you could make a copy of the exhibit builder browse view in your theme (at exhibit-builder/exhibits/browse.php), and pass the $exhibitPage parameter to
Ok, this fix works from the exhibits page. I'm using Seasons and have a page that lists some of my exhibit files separately. Is there a way to skip the summary page all the time, even from a page that is not the exhibits page?
That would depend on how your extra page works.
Since you're creating those links, you should be able to modify them in a similar way.
I'm having trouble with both options above.
The function code replacement mentioned above results in a 500 error when I attempt to navigate to my Browse Exhibits page.
Attempting to change things in the theme makes more sense to me, but I'm not sure how to call the first page (not summary) of an exhibit. What should $exhibitPage be set to in order?
Thanks in advance!
Do you have any exhibits with no pages at all?
The code I posted lazily doesn't account for that situation.
I think that was the problem, thanks. We had a test exhibit still sitting there without any pages, and when I added a page, things worked as expected.