[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] insert Altimetrics html5 code in Eprints abstract



Have a look in [ARCHIVEID]/cfg/cfg.d/z_altmetrics.pl:
$c->{plugins}->{"Screen::EPrint::Box::Altmetric"}->{appears}->{summary_bottom} = 25;
$c->{plugins}->{"Screen::EPrint::Box::Altmetric"}->{appears}->{summary_right} = undef;
 
To see how the boxes are rendered, have a look at:
EPrints::DataObj::EPrint::render

$content_left->appendChild( render_box_list( $self->{session}, $self, "summary_left" ) );
$content_right->appendChild( render_box_list( $self->{session}, $self, "summary_right" ) );
$content_bottom->appendChild( render_box_list( $self->{session}, $self, "summary_bottom" ) );
$content_top->appendChild( render_box_list( $self->{session}, $self, "summary_top" ) );

If you've changed your rendering from the EPrints default - and don't use the summary_left etc. sections, you can do something like this:
$c->{plugins}->{"Screen::EPrint::Box::Altmetric"}->{appears}->{summary_bottom} = undef;
$c->{plugins}->{"Screen::EPrint::Box::Altmetric"}->{appears}->{summary_right} = undef;

And then in [ARCHIVEID]/cfg/citations/eprint/summary_page.xml
<epc:if test="id_number or isbn">
    <div id="altmetric">
      <h2>Statistics</h2>
        <epc:choose>
          <epc:when test="id_number">
            <div id="summary_altmetric" data-doi="{id_number.as_string()}" data-altmetric-id="{id_number.as_string()}" data-altmetric-id-type="doi" data-condensed="true" class="panel panel-body" />
          </epc:when>
          <epc:when test="isbn">
            <div id="summary_altmetric" data-doi="{isbn.as_string()}" data-altmetric-id="{isbn.as_string()}" data-altmetric-id-type="isbn" data-condensed="true" class="panel panel-body" />
          </epc:when>
        </epc:choose>
        <script type="text/javascript">
          new EP_Altmetric_Badge( 'summary_altmetric' );
        </script>
	</div>
</epc:if>

Hope that helps!
Cheers,
John

-----Original Message-----
From: eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Yuri
Sent: 22 November 2017 12:18
To: eprints-tech at ecs.soton.ac.uk
Subject: Re: [EP-tech] insert Altimetrics html5 code in Eprints abstract

our @ISA = ( 'EPrints::Plugin::Screen::EPrint::Box' );

where this appears? In the abstract page?


Il 22/11/2017 12:51, John Salter ha scritto:
> Hi Yuri,
> Are you aware of this: http://bazaar.eprints.org/463/ - Altmetric plugin?
>
> I'd suggest this is the most 'standard' way of displaying Altmetrics for an EPrint!
>
> Cheers,
> John
>
> -----Original Message-----
> From: eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Yuri
> Sent: 22 November 2017 11:24
> To: EPrints.org Technical List <eprints-tech at ecs.soton.ac.uk>
> Subject: [EP-tech] insert Altimetrics html5 code in Eprints abstract
>
> Hi!
>
>   ?is there a way (maybe xml text nodes?) to insert an html5 (example:
> Altimetrics) in the abstract page? Is this procedure still valid:
>
> https://help.altmetric.com/support/solutions/articles/6000086846-using-the-altmetric-embeds-on-eprints
>
> ?
>
>
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: http://www.eprints.org/tech.php/
> *** EPrints community wiki: http://wiki.eprints.org/
> *** EPrints developers Forum: http://forum.eprints.org/
>
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: http://www.eprints.org/tech.php/
> *** EPrints community wiki: http://wiki.eprints.org/
> *** EPrints developers Forum: http://forum.eprints.org/


*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/