OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Highlight the principal author with mail associate

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

Highlight the principal author with mail associate

Postby Tiziano » Fri May 16, 2014 12:31 am

Hi!
I managed to highlight the main author with this code:

{foreach from=$article->getAuthors() item=author name=authorList}
{$author->getFullName()|escape}{assign var=primary value=$author->getPrimaryContact()}{$primary}{if !$smarty.foreach.authorList.last},{/if}
{/foreach}

but this code shows the name of the principal authors with the number "1", while other names have "0", how can I associate the email principal author?

Thanks for help.

Best Regards.
Tiziano
Tiziano
 
Posts: 94
Joined: Mon Feb 24, 2014 4:24 am
Location: Pavia, Italy

Re: Highlight the principal author with mail associate

Postby asmecher » Fri May 16, 2014 9:12 am

Hi Tiziano,

The 1s and 0s are coming from the {$primary} variable -- it'll be 1 if the author is the primary contact, 0 otherwise. I think what you want to do is something like...
Code: Select all
{if $primary}{$author->getEmail()|escape}{/if}
Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: Highlight the principal author with mail associate

Postby Tiziano » Mon May 19, 2014 12:36 am

Hi!,
it works, thanks!
I'm learning php smarty recently and I do not know well solve certain things, you can give me a hand with this?

http://pkp.sfu.ca/support/forum/viewtopic.php?f=8&t=12045

thanks for help!

By
Tiziano
Tiziano
 
Posts: 94
Joined: Mon Feb 24, 2014 4:24 am
Location: Pavia, Italy


Return to OJS Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest