How can I get only DOI number (not URL) from an article

I’m using Plum plugin and I need to get only DOI number to build the URL in article_details.tpl:

<a href="{$doiUrl|regex_replace:'/http.*org\//':''}" data-popup="top" data-size="large" class="plumx-plum-print-popup plum-liberty-theme" data-site="plum"></a>

The param “{$doiUrl|regex_replace:’/http.*org//’:’’}” isn’t working, so I’m trying to rewrite in a different way but without success. The code from template is that:

{* DOI only for large screens *}
{foreach from=$pubIdPlugins item=pubIdPlugin}
{if $pubIdPlugin->getPubIdType() != 'doi'}
{assign var=pubId value=$article->getStoredPubId($pubIdPlugin->getPubIdType())}
{if $pubId}
{assign var="doiUrl" value=$pubIdPlugin->getResolvingURL($currentJournal->getId(),     $pubId)|escape}
<a href="{$doiUrl}" class="article-doi">{$doiPrefix}/{doiSuffix}</a>

I nedd to get only DOI number. How can I do this?

The PlumAnalytics plugin found here should do that for you:

It gets the DOI from the Submission object:

Oh, thank you!

Actually, I’ve found a solution here using {$pubId}. So simple. With {$pubId} I can use on Plumb and Dimensions badge.

@geniusdesign or @ctgraham

i use OJS where should to put this code? i dont know where to put.


thank you

I would recommend using the Plum Analytics plugin, so that you don’t have to manually copy and paste code into a template file.

This is available via the Plugin Gallery in recent OJS releases, or can be downloaded manually here for 3.1.1-4:

Did you solve this question?


I put the code in articledetail.tpl and also install plugin

Here my ojs

1 Like