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
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

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: 44
Joined: Mon Feb 24, 2014 4:24 am

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: 8597
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: 44
Joined: Mon Feb 24, 2014 4:24 am


Return to OJS Technical Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron