[EP-tech] Re: {Disarmed} summary page with link
Tim Brody
tdb2 at ecs.soton.ac.uk
Mon Feb 18 09:18:19 GMT 2013
On Fri, 2013-02-15 at 13:33 +0100, Marc Marc wrote:
> Hi all,
>
>
> In my EPrints database I have a field 'catalogue_id' (e.g. ID00021)
> and I would like to create a link on the summary page:
> <a href="http://mycatalogue.com/search?ID00021">Catalogue link</a>
>
> In EPrints 3.0.5 I used the following code
> (/cfg/cfg.d/eprint_render.pl):
>
> my $catalogue_link = $session->make_element( "div",
> class=>"ep_block",
> style=>"margin-bottom: 1em" );
> my $cataloguelink = "MailScanner has detected a possible fraud
> attempt from "3c.gmx.net" claiming to be
> http://mycatalogue.com/search?" .
> $eprint->get_value( "catalogue_id" );
> $catalogue_link->appendChild( $session->html_phrase(
> "page:catalogue_link",
> url => $session->make_text( $cataloguelink ),
> link =>
> $session->render_link( $cataloguelink ) ) );
> $page->appendChild( $catalogue_link );
>
> How can I do this in EPrints 3.3.x?
> The summary page will be created via:
> /cfg/cfg.d/eprint_render.pl
> /cfg/citation/eprint/summary_page.xml
Hi,
What I would do is add a custom render method to your field definition
then in summary you can simply do:
<epc:print expr="catalogue_id" />
See:
http://wiki.eprints.org/w/API:EPrints/MetaField#Rendering
i.e.
{
name => "foo",
type => "id",
render_value => \&render_catalogue_id,
};
sub render_catalogue_id
{
my ($repo, $field, $value) = @_;
... render code
}
--
All the best,
Tim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part
Url : http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20130218/81ca0e71/attachment.bin
More information about the Eprints-tech
mailing list