EPrints Technical Mailing List Archive
Message: #05686
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] redirecting to external URLs
- To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
- Subject: Re: [EP-tech] redirecting to external URLs
- From: John Salter <J.Salter@leeds.ac.uk>
- Date: Wed, 11 May 2016 09:02:12 +0000
Hi Alan, Have a look at the ‘redir’ or ‘redir_see_other’ methods in EPrints::Apache::Rewrite. The default cfg/rewrite.pl file has a commented out example that uses this,but based on an incoming URL trigger. Cheers, John From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
On Behalf Of Alan.Stiles Thanks Matt, but it’s the latter I’m after – sending the user automatically to a new location with parameters based upon the values submitted in a form. Alan From:
eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
On Behalf Of Matthew Brady Hi Alan, Do you want the user to click on a link ? Or force the page to redirect to the new location automatically?? If it’s the former, you could do it in a similar way that the DOI’s get processed… e.g. in the eprint_fields.pl { name => 'id_number', type => 'text', render_value => 'EPrints::Extras::render_possible_doi', }, Then in perl_lib/EPrints/extras.pm sub render_possible_doi { my( $session, $field, $value ) = @_;
$value = "" unless defined $value; if( $value !~ /^(doi:)?10\.\d\d\d\d\// ) { return $session->make_text( $value ); }
$value =~ s/^doi://; my $url = "" href="http://dx.doi.org/$value">http://dx.doi.org/$value"; my $link = $session->render_link( $url ); $link->appendChild( $session->make_text( $value ) ); return $link;
} This will take the value entered into the id_number field, and render it as a link on the screen, prefixing it with the appropriate http url leader
etc… Cheers Matt From:
eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
On Behalf Of Alan.Stiles So anyone know how I should be redirecting the user to an alternative URL based on some processing in a Screen action? As it is, I’m setting the url in the action by $self->{processor}->{redirect_to_url} = “http://example.org”; and then checking for it in sub redirect_to_me_url { … return $self->{processor}->{redirect_to_url}; } It seems a little too hacky! Cheers, Alan Stiles Digital Repository Developer Library Services, The Open University -- The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England & Wales and a charity registered in Scotland
(SC 038302). The Open University is authorised and regulated by the Financial Conduct Authority.
_____________________________________________________________
This email (including any attached files) is confidential and is for the intended recipient(s) only. If you received this email by mistake, please, as a courtesy, tell the sender, then delete this email.
The views and opinions are the originator's and do not necessarily reflect those of the University of Southern Queensland. Although all reasonable precautions were taken to ensure that this email contained no viruses at the time it was sent we accept no liability for any losses arising from its receipt.
The University of Southern Queensland is a registered provider of education with the Australian Government.
(CRICOS Institution Code QLD 00244B / NSW 02225M, TEQSA PRV12081 )
|
- References:
- [EP-tech] redirecting to external URLs
- From: "Alan.Stiles" <alan.stiles@open.ac.uk>
- Re: [EP-tech] redirecting to external URLs
- From: Matthew Brady <Matthew.Brady@usq.edu.au>
- Re: [EP-tech] redirecting to external URLs
- From: "Alan.Stiles" <alan.stiles@open.ac.uk>
- [EP-tech] redirecting to external URLs
- Prev by Date: Re: [EP-tech] [solved] redirecting to external URLs
- Next by Date: Re: [EP-tech] Problems with the Coversheets plugin
- Previous by thread: Re: [EP-tech] redirecting to external URLs
- Next by thread: Re: [EP-tech] [solved] redirecting to external URLs
- Index(es):