OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Removing abstract links in sections that allow them?

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.

Removing abstract links in sections that allow them?

Postby zoot » Wed Feb 22, 2006 9:22 am

Is there any way to post an article with no abstract link within a section that allows abstracts? I noticed that these guys seem to have done it, but I'm not sure how: http://journal.lib.uoguelph.ca//index.p ... ue/current (scroll down to the Book/Media Reviews section).
zoot
 
Posts: 2
Joined: Wed Feb 22, 2006 9:14 am

Postby asmecher » Wed Feb 22, 2006 10:11 am

Hi Zoot,

You'll have to make a slight modification to a few templates to accomplish this. Edit templates/issue/issue.tpl and change (approx. line 20):
Code: Select all
<a href="{url page="article" op="view" path=$article->getBestArticleId($currentJournal)}" class="file">{if $section.abstractsDisabled}{translate key="article.details"}{else}{translate key="article.abstract"}{/if}</a>

to:
Code: Select all
{if $article->getArticleAbstract() || !$article->getGalleys() || (!(!$subscriptionRequired || $article->getAccessStatus() || $subscribedUser || $subscribedDomain))}<a href="{url page="article" op="view" path=$article->getBestArticleId($currentJournal)}" class="file">{if $section.abstractsDisabled}{translate key="article.details"}{else}{translate key="article.abstract"}{/if}</a>{/if}
You'll need to make a similar change to the search results template, templates/search/searchResults.tpl.

This will cause the "Abstract" (or "Details" when abstracts are disabled) link to be displayed only if 1) there is an abstract available for viewing or 2) no galley link (e.g. PDF or HTML) is available. To prevent the link from being displayed, just make sure the field is blank.

Regards,
Alec Smecher
Open Journal Systems Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Postby zoot » Wed Feb 22, 2006 12:22 pm

That worked like a charm for templates/issue/issue.tpl. Thanks much.

Not to be ungrateful, but could you post the code chage for templates/search/searchResults.tpl ? I keep knocking out the galley links along with the abstract links, and my code skills are insufficient to determine why.

Thanks again!
zoot
 
Posts: 2
Joined: Wed Feb 22, 2006 9:14 am

Postby asmecher » Wed Feb 22, 2006 12:44 pm

Hi Zoot,

Around line 89 of templates/search/searchResults.tpl, change:
Code: Select all
<a href="{url journal=$journal->getPath() page="article" op="view" path=$publishedArticle->getBestArticleId($journal)}" class="file">{if $section->getAbstractsDisabled()}{translate key="article.details"}{else}{translate key="article.abstract"}{/if}</a>{if $publishedArticle->getAccessStatus() || $issueAvailable}{foreach from=$publishedArticle->getGalleys() item=galley name=galleyList}&nbsp;<a href="{url journal=$journal->getPath() page="article" op="view" path=$publishedArticle->getBestArticleId($journal)|to_array:$galley->getGalleyId()}" class="file">{$galley->getLabel()|escape}</a>{/foreach}{/if}

to:
Code: Select all
{if $publishedArticle->getArticleAbstract() || !$publishedArticle->getGalleys() || (!($publishedArticle->getAccessStatus() || $issueAvailable))}<a href="{url journal=$journal->getPath() page="article" op="view" path=$publishedArticle->getBestArticleId($journal)}" class="file">{if $section->getAbstractsDisabled()}{translate key="article.details"}{else}{translate key="article.abstract"}{/if}</a>{/if}{if $publishedArticle->getAccessStatus() || $issueAvailable}{foreach from=$publishedArticle->getGalleys() item=galley name=galleyList}&nbsp;<a href="{url journal=$journal->getPath() page="article" op="view" path=$publishedArticle->getBestArticleId($journal)|to_array:$galley->getGalleyId()}" class="file">{$galley->getLabel()|escape}</a>{/foreach}{/if}
Regards,
Alec Smecher
Open Journal Systems Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot] and 3 guests