Shortcodes in Exhibit

I’d like to make my Exhibit support shortcodes (see https://forum.omeka.org/t/adding-shortcode-support-to-exhibit-builder/1167)

In /omeka/plugins/ExhibitBuilder/helpers/ExhibitPageFunctions.php there is a function “exhibit_builder_render_exhibit_page” – I’ve tried changing this line

'text' => $block->text,

to

'text' => shortcode($block->text),

but I get the error

Fatal error: Call to undefined function shortcodes()

I see that that function exists in /omeka/application/views/helpers/Shortcodes.php but I’m not sure why it’s not available to me here, even if I include that file. What am I missing? Why is this function not available in this plugin but it is in, e.g., /omeka/plugins/SimplePages/views/public/page/show.php

Thanks for the help…

Shortcodes is a view helper, not a function.

You’d call it from within that function by calling get_view()->shortcodes()

1 Like