You are viewing the PKP Support Forum | PKP Home Wiki

Manipulate the download link

OJS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

Manipulate the download link

Postby Szdnez » Thu Jan 07, 2010 5:23 pm


I want to "manipulate" the links that are generated to downald e.g. a pdf of an article. For example
Code: Select all
<meta http-equiv="refresh" content="2;URL=http://localhost/ojs/index.php/MyMagazin/article/download/1/1"/>
in interstitial.tpl should look like this
Code: Select all
<meta http-equiv="refresh" content="2;URL=http://vg07.met.vgwort.de/na/46077f60b9fce26ee4ff9008ca6978?l=http://localhost/ojs/index.php/MyMagazin/article/download/1/1"/>

I do not want to edit interstitial.tpl or the Request::url() (where the link is generated) because this are system files/classes. But I have no idea how could I do this in another way. Can I register a plugin to do this (which hook?) ? Or are there other technics?

Thanks for your help
Posts: 17
Joined: Tue Oct 20, 2009 12:48 pm

Re: Manipulate the download link

Postby mcrider » Thu Jan 14, 2010 1:42 pm

Hi Szdnez,

Honestly, I would just edit the template and keep track of the change for when you upgrade (since it is such a simple fix). If you wanted to do this with a plugin, you could do it with an output filter plugin (see for example the SEHL plugin in plugins/generic/sehl/)... These plugins take OJS' output and allow you to filter it and make modifications (so it would wait for the <meta> tag and then output something else).

Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: Manipulate the download link

Postby Szdnez » Sat Jan 16, 2010 10:52 am

Thanks for the advice. It is quite ugly to parse the html code but it works now without manipulating any core classes. And for the future, do not change interstitial.tpl or pdfInterstitial.tpl ;-)
Posts: 17
Joined: Tue Oct 20, 2009 12:48 pm

Return to OJS Development

Who is online

Users browsing this forum: Google [Bot] and 1 guest