[SOLVED] Corresponding Author Name, and Affiliation show on Article Page

Iam doing customizing file templates/article/article.tpl to show Corresponding Author Name, and Affiliation on article page, with line code below :
delete this line code

<div id="authorString"><em>{$article->getAuthorString()|escape}</em></div>

and adding line code below

 {assign var=count value=0}
        {foreach from=$article->getAuthors() item=author name=authorList}
		{assign var=fullname value=$author->getFullName()}
		{assign var="contact" value=$author->getData('primaryContact')}
		{assign var=count value=$count+1}
        {if $fullname||$count}{$fullname|escape}<sup>({if $contact eq 1}{$count|escape}*{else}{$count|escape}{/if})</sup>, {/if}
   {/foreach}
         <br>
{assign var=count value=0}
    {foreach from=$article->getAuthors() item=author name=authorList}
            {assign var=authorAffiliation value=$author->getLocalizedAffiliation()}
		{assign var=count value=$count+1}
		{if $authorAffiliation||$count}<br />({$count|escape})&nbsp{$authorAffiliation|escape}{/if}
   {/foreach}
         <br> (*) Corresponding Author
         <br>

and article page show like pict below

but I have problem, author list have comma on last author name. How to not show comma on the last author name?

4 Likes

Hi @andrewdion04

I think you could use something like:
{if not $smarty.foreach.authorList.last}, {/if}

Best,
Bozana

Iam adding the code become like this below

{if $fullname||$count}{$fullname|escape}<sup>({if $contact eq 1}{$count|escape}*{else}{$count|escape}{/if})</sup>{if not $smarty.foreach.authorList.last}, {/if}

the articel page become blank page.

Hi @andrewdion04

Do you also have one more closing {/if} ? Did you take a look in the error log file?

Best,
Bozana

Ahh Iam forgot closing code
{if $fullname||$count}{$fullname|escape}<sup>({if $contact eq 1}{$count|escape}*{else}{$count|escape}{/if})</sup>{if not $smarty.foreach.authorList.last}{/if},{/if}

but still the last author name have comma like below
Chesara Novatiano(1*), Adi Pancoro(2), Erly Marwani(3),

you put the comma in the wrong place

{if $fullname||$count}{$fullname|escape}<sup>({if $contact eq 1}{$count|escape}*{else}{$count|escape}{/if})</sup>{if not $smarty.foreach.authorList.last},{/if}{/if}

ahhh thank you very much, perfect now!!

I think that this solution should be included in the next version of OJS. A couple of editorial boards asked me to include that feature.

1 Like

Hello @andrewdion04
How listing of authors below article title works in OJS 3.1.1.4?

Thanks

I support this request

here is a related development:

sorry can’t answer that because Iam not yet trying OJS 3.X version

im so interest this. how can i get author email address?

I think write email address of corresponding author in Article_detail.php is good. but i dont know how to get email address.

Hi, that’s how I solved it.

[3.1.2]
{$author->getFullName()|escape}
{assign var=primary value=$author->getPrimaryContact()}
{if $primary}
{mailto address=$author->getEmail()|escape}
{/if}

[OJS 3.2.0.1]
{assign var=primary value=$publication->getData(‘primaryContactId’)}
{if $primary == $author->getId()}
{mailto address=$author->getEmail()|escape}
{/if}

its work. thank you. very helpfull

1 Like