michal84
posted this
08 April 2024
AI returns to me the following code. So it might be able just to implement this:
<?php
// Get the current article
$article = JFactory::getDocument()->getBuffer('component');
// Get the previous article
$prevArticle = $article->get('prev');
if ($prevArticle) {
echo '<a href="' . JRoute::_(ContentHelperRoute::getArticleRoute($prevArticle->slug, $prevArticle->catid)) . '">Previous</a>';
}
// Get the next article
$nextArticle = $article->get('next');
if ($nextArticle) {
echo '<a href="' . JRoute::_(ContentHelperRoute::getArticleRoute($nextArticle->slug, $nextArticle->catid)) . '">Next</a>';
}
?>
Thanks for your effort to make this working.
Kind regards,
Michal
AI returns to me the following code. So it might be able just to implement this:
<?php
// Get the current article
$article = JFactory::getDocument()->getBuffer('component');
// Get the previous article
$prevArticle = $article->get('prev');
if ($prevArticle) {
echo '<a href="' . JRoute::_(ContentHelperRoute::getArticleRoute($prevArticle->slug, $prevArticle->catid)) . '">Previous</a>';
}
// Get the next article
$nextArticle = $article->get('next');
if ($nextArticle) {
echo '<a href="' . JRoute::_(ContentHelperRoute::getArticleRoute($nextArticle->slug, $nextArticle->catid)) . '">Next</a>';
}
?>
Thanks for your effort to make this working.
Kind regards,
Michal