isLast class

Permalink Browser Info Environment
How do I get the isLast class to work? In the base Manual Nav block code, I see:

foreach ($links as $link):
$cssClasses = array();

if ($link->isCurrent) {
$cssClasses[] = 'nav-selected';
}

But even isCurrent doesn't seem to be working either.

Type: Discussion
Status: New
allitik
View Replies: View Best Answer
jordanlev replied on at Permalink Best Answer Reply
jordanlev
There is no "isLast" functionality built-in to this addon. But you could achieve something like it by changing the manual_nav view.php file to this:

<?php  defined('C5_EXECUTE') or die(_("Access Denied.")); ?>
<ul class="ccm-manual-nav">
<?php
$last_link_index = count($links) - 1;
foreach ($links as $index => $link):
   $cssClasses = array();
   if ($link->isCurrent) {
      $cssClasses[] = 'nav-selected';
   }
   if ($link->inPath) {
      $cssClasses[] = 'nav-path-selected';
   }
   if ($index == $last_link_index) {
      $cssClasses[] = 'isLast';
   }
allitik replied on at Permalink Reply
allitik
Ahh, I had thought that since I saw similar code (isCurrent) to the autonav, the same functions would be available. Thank you for this, it works well for me!

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.