-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ModuleArticleList.php returning the article title as link #694
Comments
|
Ahh, I forgot I changed my template file.. Then I have to extend this: I recommend to extend this: while ($objArticles->next())
{
// Skip first article
if (++$intCount <= intval($this->skipFirst))
{
continue;
}
$strAlias = $objArticles->alias ?: $objArticles->id;
$cssID = \StringUtil::deserialize($objArticles->cssID, true);
$articles[] = array
(
'link' => $objArticles->title,
'title' => \StringUtil::specialchars($objArticles->title),
'id' => $cssID[0] ?: 'article-' . $objArticles->id,
'articleId' => $objArticles->id,
'url' => ($objTarget ?: $objPage)->getFrontendUrl('/articles/' . $strAlias)
);
}Now I can do something like this: <li><a href="<?= $article['url'] ?>" title="<?= $article['title'] ?>"><?= $article['link'] ?></a></li> |
|
I think a correct article link is what you get if you display article as teaser - the usecase for ModuleArticleList is onpage-navigation as far as i understand. |
|
I also think it's mainly for onpage-navigation. But what is the sense to be able to select a reference page then? The links directing to the page and the anchor position. At least there should be also returned the alias to be able to generate a correct article link. while ($objArticles->next())
{
// Skip first article
if (++$intCount <= intval($this->skipFirst))
{
continue;
}
$cssID = \StringUtil::deserialize($objArticles->cssID, true);
$articles[] = array
(
'link' => $objArticles->title,
'title' => \StringUtil::specialchars($objArticles->title),
'id' => $cssID[0] ?: 'article-' . $objArticles->id,
'articleId' => $objArticles->id,
'alias' => $objArticles->alias
);
}So I can create a full article link in my template: <li><a href="<?= $this->request ?>/articles/<?= $article['alias'] ?>" title="<?= $article['title'] ?>"><?= $article['link'] ?></a></li> |
|
i see... |
|
I have added the |
In the class ModuleArticleList.php the link parameter in the returning array should give the alias instead of the title.
The text was updated successfully, but these errors were encountered: