Hi Daniel,
Thank you for your answer
I checked your plugin and it basically worked well, but I also noticed problem (error) when trying to open last added element in any collection. Then I found a message from annelien, so I switched off the ItemOrder plugin and it helped!
Thanks a lot!
Borys
Plugins work together now. So I’m guessing you just have to install it without changing anything to the code?
In my omeka-test-site I have 2 collections. When in my first collection I tested clicking ‘next’ a bunch of times, it stayed perfectly in the current collection.
Then I tried the same thing with the ‘previous’-link. For some reason did not do the job. Then I tried the same things in de second collection, here the next & previous worked like before, jumping to other collections. When I went back to my first collection, again the next-button worked fine, the previous not.
I have no idea what is going on, because everything is called the same way, so I have nu clue why they would react differently to the plugin.
Am I doing anything wrong? Should I change something in my code?
I fixed the plugin again. Now, it works better when the plugin itemOrder is enabled, but not ready. So use Helpers alone or with ItemOrder, according to your needs.
Okay, I double checked everything. Maybe it does work, just not in the way I was expecting it to and it got me confused in a way?
So what I guess it is doing now:
When you click next, you go the next item in the collection (defined by item order plugin)
When it is the last item of that collection, it goes to the first item of the next collection
When you click previous, you go the previous item in the collection (defined by item order plugin)
When it is the first item of that collection it goes to the first item of the previous collection.
What I expected it to is about the same, but I want the last item of a collection to
OR not display a ‘next button’, because te collection is finished
OR go back to the first item of the same collection
same methods for ‘previous’
So like this, there will be no possibility to just jump from one collection to another without even noticing.
If this is not what your plugin does, then I am sorry for the misunderstanding.
Hi, here is my report:
On my site www.3d-muzeum.pl with last version of Helpers, everything works as you want: from the last item it goes to the first of the same collection, and previous from the first is the last.
Maybe because I have ItemOrder switched off…
Thank you David for this plugin!
When item order plugin is not enabled, the order is defined according to the element set in the config, alphabetically (generally title or date).
A plugin can do a lot, but the more you want a specific behavior, the more you have to go to the code.
Here, you can check the collection before printing the buttons. You can use the helpers $this->getPreviousItem() and $this->getNextItem() and $this->getItemInCollection() in your theme too. See the code, it is documented.