[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
Agrobacterium%20tumefaciens%20mediated%20transformation%20of%20Jatropha%20curcas%20L%20%20with%20a%20polyhydroxyalkanoate%20gene%20%20phaC%20%20%20%20Novatiano%20%20%20Indonesian%20Journal%20of%20Biotechnology

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!!

Agrobacterium%20tumefaciens%20mediated%20transformation%20of%20Jatropha%20curcas%20L%20%20with%20a%20polyhydroxyalkanoate%20gene%20%20phaC%20%20%20%20Novatiano%20%20%20Indonesian%20Journal%20of%20Biotechnology

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:

https://github.com/pkp/pkp-lib/issues/3782

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}

2 Likes

its work. thank you. very helpfull

1 Like

Many thanks for your very helpful guide.

Hai @andrewdion04

The way you present the author and affiliation is good, however it’s still not cool. Because there are still the names of the second and third authors with the same affiliation. Second and third author affiliations may only be shown once.

Then, how do the second and third author affiliations only be numbered 2 for each author and the affiliation is only shown once for both authors? Like this…

Screen Shot 2022-10-09 at 23.12.50

Each author of course has very likely to have more than one affiliation or it could be that all authors come from one affiliation.

UNDIP journals do that? Can anyone help?

cc @asmecher @ajnyga

Regards,
Rochmady

Hi @Rochmady,

This is an old thread, so I’m going to close it, but I recommend joining this conversation about supporting RoR identifiers for affiliations. Currently without the RoR plugin OJS uses a plain-text field for affiliations, which means grouping authors by affiliations isn’t possible to do well (e.g. Simon Fraser University is different from SFU is different from Simon Fraser); RoR identifiers make it possible to group authors definitively with the same identifier.

If RoR doesn’t suit your needs (see the limitations in the mentioned thread), I’d suggest starting a new topic starting there.

Regards,
Alec Smecher
Public Knowledge Project Team