Uppercase author last names in article landing page

A journal which I’m assisting is entering the author names all caps (uppercase) in the metadata fields. That’s because their preferred citation format specifies so. Obviously it affects Crossref and everything downstream.

Would it be possible to change the OJS theme (v2) to show the last name all caps in the article landing page? If so, then I could advise the journal to enter author names with capitalizing initials only.

I looked into templates/article/article.tpl and found $article->getAuthorString().
Then I looked into classes/issue/Issue.inc.php and found this:

function getAuthorString($lastOnly = false, $separator = ', ') {
	$str = '';
	foreach ($this->getAuthors() as $a) {
		if (!empty($str)) {
			$str .= $separator;
		}
		$str .= $lastOnly ? $a->getLastName() : $a->getFullName();
	}
	return $str;
} 

So it seems the change required cannot be accomplished simply as a theme update?

Thanks,
-FGN.

In OJS 3, I would simply override a template from a child theme, retrieved surname with correspondent method, and applies styling text-transform on this element.

So you can simply iterate through authors like in the method you mentioned from an article landing page template: {foreach from=$article->getAuthors() item=author}...{/foreach}

Thanks, @Vitaliy. But that could make the full name uppercase, no?
The citation style the journal likes makes only the last name uppercase.

Previously I looked at OJS2. Now looking at OJS3, the situation is:

  • in ojs/templates/frontend/objects/article_details.tpl:
  	{if $article->getAuthors()}
  		<ul class="item authors">
  			{foreach from=$article->getAuthors() item=author}
  				<li>
  					<span class="name">
  						{$author->getFullName()|escape}
  					</span>
  • in pkp-lib/classes/identity/Identity.inc.php:

/**

  • Get the identity’s localized complete name.
  • Includes given name and family name.
  • @param $preferred boolean If the preferred public name should be used, if exist
  • @param $familyFirst boolean False / default: Givenname Familyname
  • If true: Familyname, Givenname
  • @param $defaultLocale string
  • @return string
    */
    function getFullName($preferred = true, $familyFirst = false, $defaultLocale = null) {
    $locale = AppLocale::getLocale();
    if ($preferred) {
    $preferredPublicName = $this->getPreferredPublicName($locale);
    if (!empty($preferredPublicName)) return $preferredPublicName;
    }
    $givenName = $this->getGivenName($locale);
    if (empty($givenName)) {
    if (is_null($defaultLocale)) {
    // the users register for the site, thus
    // the site primary locale is the default locale
    $site = Application::get()->getRequest()->getSite();
    $defaultLocale = $site->getPrimaryLocale();
    }
    $locale = $defaultLocale;
    $givenName = $this->getGivenName($locale);
    }
    $familyName = $this->getFamilyName($locale);
    if ($familyFirst) {
    return ($familyName != ‘’?"$familyName, " :’’) . $givenName;
    } else {
    return $givenName . ($familyName != ‘’?" $familyName" :’’);
    }
    }

But there are new functions to get given and family names separately:

/**

  • Get the localized given name
  • @return string
    */
    function getLocalizedGivenName() {
    return $this->getLocalizedData(IDENTITY_SETTING_GIVENNAME);
    }

/**

  • Get the localized family name
  • Return family name for the locale first name exists in
  • @param $defaultLocale string
  • @return string
    */
    function getLocalizedFamilyName($defaultLocale = null) {
    $locale = AppLocale::getLocale();
    $givenName = $this->getGivenName($locale);
    if (empty($givenName)) {
    if (is_null($defaultLocale)) {
    // the users register for the site, thus
    // the site primary locale is the default locale
    $site = Application::get()->getRequest()->getSite();
    $defaultLocale = $site->getPrimaryLocale();
    }
    $locale = $defaultLocale;
    assert(!empty($this->getGivenName($locale)));
    }
    return $this->getFamilyName($locale);
    }

So my conclusion is that it’s possible in OJS3 but not in OJS2.

FGN

According to OJS 2.4.8 code, authors from the instance of Article object can be retrieved with getAuthors() method and from Author getLastName() can be used.

Thanks for the heads up, I’ll try your suggestion!