2

I want to modify: /plugins/content/pagenavigation/tmpl/default.php.

There are 2 <li> tags, one for "next" and one for "previous".

I want to display the current article's title in a <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>
1

You can use this:

<li class="middle"><?php echo htmlspecialchars($rows[$location]->title); ?></li>

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.