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="https://plu.mx/plum/a/?doi={$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'}
{php}continue;{/php}
{/if}
{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>
{/if}
{/foreach}

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 3.1.1.4 where should to put this code? i dont know where to put.

image

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?

Yes.

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

Here my ojs
Http://Owner.polgan.ac.id

1 Like