I want to display recently published articles using a custom function in my theme.
So far I can manage to display the latest issues with help of @ajnyga
How to get the list of latest articles along with author names by using issue id?
$articleslistDao = DAORegistry::getDAO('PublishedArticleDAO');
$articles[$issueId]=$articleslistDao->getPublishedArticles($issueId);
foreach($articles as $article){
$articleId = $article[0]->_data['id'];
$published[$articleId]['title']=$article[0]->_data['title'];
}
I can get only title of the articles, but I want the path and also author names.
OJS 3.0.2
Thanks in advance
ajnyga
August 13, 2017, 4:34pm
2
You can use
$article->getId()
$article->getLocalizedTitle()
$article->getAuthors()
With the path, you can use in a smarty template something like this:
<a href="{url page="article" op="view" path=$article->getBestArticleId()}" class="title">
Thank you,
I will try it.
$articleslistDao->getPublishedArticles($issueId);
This method returns only one article from the issue. Am I missing anything?
ajnyga
August 14, 2017, 12:35pm
4
It definitely should not: https://github.com/pkp/ojs/blob/master/classes/article/PublishedArticleDAO.inc.php#L91
In the issueHandler they are using a similar functions which also includes the journal sections.
$paymentManager->queuePayment($queuedPayment);
$paymentForm = $paymentManager->getPaymentForm($queuedPayment);
$paymentForm->display($request);
exit;
}
}
if (!Validation::isLoggedIn()) {
Validation::redirectLogin('reader.subscriptionRequiredLoginText');
}
$request->redirect(null, 'about', 'subscriptions');
}
}
} else {
$request->redirect(null, 'index');
}
return true;
}
public function setupTemplate($request)