i was looking for a way to build a author gallery. Therefore i created a custom function within the AuthorHandler.inc.php
- Code: Select all
function faculty() {
$templateMgr = &TemplateManager::getManager();
$authorDao =& DAORegistry::getDAO('AuthorDAO');
$authors =& $authorDao->getAuthorsAlphabetizedByJournal();
$templateMgr->assign('authors', $authors);
$templateMgr->display('author/faculty.tpl');
}
Afterwards i created a template (faculty.tpl) where i wanted to display data belonging to the authors
- Code: Select all
{iterate from=authors item=author}
{assign var=fullName value=$author->getFullName()}
{assign var=firstName value=$author->getFirstName()}
{assign var=middleName value=$author->getMiddleName()}
{assign var=lastName value=$author->getLastName()}
{assign var=authorId value=$author->getAuthorId()}
{assign var=imageUrl value=$author->getUrl()}
<div class="authorGalleryItem">
<a href="{url page="search" op="authors" path="view" firstName=$firstName middleName=$middleName lastName=$lastName affiliation=$authorAffiliation country=$authorCountry}">
<img src="{$baseUrl}/public/site/profileImage-6.jpg" />
</a>
<div class="subline"> </div>
<div class="authorGalleryName">{$fullName}</div>
<div class="subline">{$authorId}{$imageUrl}</div>
</div>
{/iterate}
Unfortunatelly, just the retrieval of the authors names is working correctly (getFullName(), getFirstName(), getMiddleName(), getLastName()).
Whereas getAuthorId() is retruning a "0" for all of my authors an getUrl() isn't returning any value at all. I checked that the url is present in the article_autors table within the database. I'm claerly missing some detail, but i can't figure out what it is...
thanks for your help in advance
Thomas
