Custom Prev/next Block
Permalink
Hi,
I'm currently working on a site for an artist.
With the prev/next block you can move through the artwork pages.
You can see my example here:http://grafomantestsite.be/index.php/works/Deep-Blue...
I customized the view.php file for the block like this:
Now for my question: is it possible to hide the previous link when there is no previous page? So you just have 'ALL WORKS NEXT > '
And to hide the next link when there is no next page? So you just have ' < PREVIOUS ALL WORKS '
Thanks!
I'm currently working on a site for an artist.
With the prev/next block you can move through the artwork pages.
You can see my example here:http://grafomantestsite.be/index.php/works/Deep-Blue...
I customized the view.php file for the block like this:
<?php defined('C5_EXECUTE') or die("Access Denied."); $nh = Loader::helper('navigation'); $previousLinkURL = is_object($previousCollection) ? $nh->getLinkToCollection($previousCollection) : ''; $parentLinkURL = is_object($parentCollection) ? $nh->getLinkToCollection($parentCollection) : ''; $nextLinkURL = is_object($nextCollection) ? $nh->getLinkToCollection($nextCollection) : ''; $previousLinkText = is_object($previousCollection) ? $previousCollection->getCollectionName() : ''; $nextLinkText = is_object($nextCollection) ? $nextCollection->getCollectionName() : ''; ?> <?php if ($previousLinkURL || $nextLinkURL || $parentLinkText): ?> <div class="ccm-block-next-previous-wrapper"> <?php if ($previousLinkText): ?> <span class="ccm-block-next-previous-previous-link"> <?php echo $previousLinkURL ? '<a href="' . $previousLinkURL . '">' . '< Previous' . '</a>' : '' ?> </span> <?php endif; ?>
Viewing 15 lines of 27 lines. View entire code block.
Now for my question: is it possible to hide the previous link when there is no previous page? So you just have 'ALL WORKS NEXT > '
And to hide the next link when there is no next page? So you just have ' < PREVIOUS ALL WORKS '
Thanks!
I added a screenshot of the sitemap
When i check 'loop navigation' the next and previous button become visible, but the links to the next and previous pages are not correct. However, the loop function links work..
So the problem is with the link to the next page, when there is no loop. And the link to the previous page, again, when there is no loop.