adding curent item to pagenavigation

by sofian   Last Updated January 10, 2019 23:10 PM

i speak about /plugins/content/pagenavigation/tmpl/default.php .

there is 2 li , one for next and one for previous . i want to display the curent article's title in li between them . what is the code to show the title of the present article .

 <ul class="pager pagenav">
<?php if ($row->prev) :
    $direction = $lang->isRtl() ? 'right' : 'left'; ?>
    <li class="previous">
        <a class="hasTooltip" title="<?php echo htmlspecialchars($rows[$location-1]->title); ?>" aria-label="<?php echo JText::sprintf('JPREVIOUS_TITLE', htmlspecialchars($rows[$location-1]->title)); ?>" href="<?php echo $row->prev; ?>" rel="prev">
            <?php echo '<span class="icon-chevron-' . $direction . '" aria-hidden="true"></span> <span aria-hidden="true">' . $row->prev_label . '</span>'; ?>
        </a>
    </li>
<?php endif; ?>

<li class="middle"> code of curent item ?? </li>


<?php if ($row->next) :
    $direction = $lang->isRtl() ? 'left' : 'right'; ?>
    <li class="next">
        <a class="hasTooltip" title="<?php echo htmlspecialchars($rows[$location+1]->title); ?>" aria-label="<?php echo JText::sprintf('JNEXT_TITLE', htmlspecialchars($rows[$location+1]->title)); ?>" href="<?php echo $row->next; ?>" rel="next">
            <?php echo '<span aria-hidden="true">' . $row->next_label . '</span> <span class="icon-chevron-' . $direction . '" aria-hidden="true"></span>'; ?>
        </a>
    </li>
<?php endif; ?>
</ul>

thanks

Tags : php


Related Questions