I’m just starting to play with Omekas. I have encountered a problem that I can’t solve. I want to add previous / next buttons to easily browse next item. Such buttons were in the Omeka Clasic. I found the Next module, which according to the description adds such functionality. I installed. But the “Disable previous / next” option doesn’t work. It’s unchecked. I’m using the mariadb database. The previous / next buttons in the item view do not appear. Can you help me add such buttons?
It is inserted automatically in admin, but it should be added manually in the theme.
As an example:
$plugins = $this->getHelperPluginManager(); $hasNext = $plugins->has('previousResource'); ?> <?php if ($hasNext): ?> <div class="previous-next-items"> <?php if ($previous = $this->previousResource($resource)): ?> <?= $previous->link($translate('Previous item'), null, ['class' => 'previous-item']) ?> <?php endif; ?> <?php if ($next = $this->nextResource($resource)): ?> <?= $next->link($translate('Next item'), null, ['class' => 'next-item']) ?> <?php endif; ?> </div> <?php endif; ?>
Hmm. There is no mention of this code in the plugin documentation.
I add this code to the theme, but unfortunately it doesn’t work.
After adding the code, the blank page is displayed.
This is a code i use in a living site.
Display the log to see the issue.
Ok, thanks for help. I was able to add Next / Previous button.
But there is another problem. After enabling the Next module, the (Straight Page) pages are not displayed. The home page then displays: Omeka S encountered an error.
When I disable the Next module, everything is fine.
file application.log is empty.
Hard to know the issue without more details. I use this module on many sites. The two errors I know are the user bar in some cases and the next previous (that can be disabled in the main settings).
I think I found the source of the error. I see the following message after selecting in the browser: “Inspec telement”
“Error processing values for “display”. Declaration abandoned. style.css: 764: 14”
This issue is related to the theme (html/css/js), not to the module. The module only creates a link
I am trying to get your code work on a site you’re working on (Ibn Battuta, MCM) but it does not work, unfortunately. I’ve seen this in the logs : “Call to a member function has() on null”. The snippet you gave above contains indeed the function has().
Thank you in advance.
PS : By the way, you are a great plugin developer but it would very useful for the users if you could explain a bit more how to use them in the readme sections.
<?php is missing at the beginning of the snippet above.