Hi everyone,
I am trying to develop my first a plugin in omeka, so I apologise for the basic question. I wanted to create a shortcode, where you can customise the browsing view for different collections. Here is a simple example to clarify it:
For conferences items, I want to filter the only conferences that will happen after today and present only an image and description of each.
For book items, I want to to show all books in the list but with name author and image.
My idea is to have multiple views in the plugin folder (later I will enable their creation in the admin part of the page), which are selected according to a parameter in the shortcode. Currently, I successfully added the shortcode and can use the view provided by omeka:
…
public function hookInitialize()
{
add_shortcode(‘my_shortcode’, array($this, ‘collections_filter’));
}
public static function collections_filter($args, $view)
{
$collections = get_records('Collection', $params, $limit);
$content = '';
foreach ($collections as $collection) {
$content .= $view->partial('collections/single.php', array('collection' => $collection));
}
return $content;
}
}
My question is: How can I, instead of calling “collections/single.php”, call a specific view of the plugin? For example, …/PLUGIN/views/shared/Conf_browse.php
Thank you,