OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



cross link html pages?

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

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

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a technical support question, try the OJS Technical Support subforum.

cross link html pages?

Postby downtheroad » Wed Mar 18, 2009 8:14 am

If I am loading html files via xml import, is there any way to link from one html page to another (for instance, if one page wants to link to relevant content in another page)?

DTR
downtheroad
 
Posts: 25
Joined: Tue Jan 13, 2009 9:48 am

Re: cross link html pages?

Postby jmacgreg » Wed Mar 18, 2009 10:21 pm

Hi DTR,

You (almost*) can, but this isn't a particularly well-documented feature of OJS (obscure enough that I have to do some extensive digging myself to remember how to do it), and you'll need some forethought before proceeding.

In a nutshell, you'll need to start using public IDs to identify issue/article/galley level content (you can turn on public IDs in Journal Setup Step 4.3); ensure that each item is given a public identifier as appropriate; and then include the appropriate link in your HTML galley.

Public identifiers can be set from the following locations:

- issue ID: can be set from the issue's Issue Data page, and isn't necessary for this example.
- article ID: can be set from the issue's Table of Contents page for each article in the issue.
- galley ID: can be set from the submission's Galley Edit/Data page. You can set these for PDFs as well, if you'd like.

OJS-aware links can be formatted as follows:

Code: Select all
ojs://article/(articleId)/(galleyId)


You can also create a normal hyperlink as follows:

Code: Select all
http://example.com/index.php/jr1/article/view/(articleId)/(galleyId)[code]

... so if you had an article by James MacGregor, and split it into multiple HTML files, your links would probably look something like:

[code]http://example.com/index.php/jr1/article/view/macgregor/1
http://example.com/index.php/jr1/article/view/macgregor/2


... where you've assigned 'macgregor' to the article ID, and '1'/'2'/etc. to the galley ID, and so on.

This is just a quick write-up, but I'll be returning to and expanding it in the near future -- give it a shot, and any feedback would be much appreciated. This was a fairly recent implementation (http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=3231), and could probably use some hands-on experience.

* One more quick note, actually: you can include public IDs for issues and articles using the importexport plugin, but as of yet you can't specify public IDs for galleys. I've reported this, and will try and get a patch up shortly: http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=4141.

Cheers,
James
jmacgreg
 
Posts: 4182
Joined: Tue Feb 14, 2006 10:50 am

Re: cross link html pages?

Postby Shiralee » Fri Mar 27, 2009 6:39 pm

Sorry to butt into this tyopic -- but I have a related problem -- OJS is re-writing my urls that are calling for non-ojs content -- eg self-generated paginated pdfs, and images required for an embedded javascript slideshow. It re-writes bothy absolute and relative urls so nothing is working! I've run out of ideas... and help very appreciated -- I do every damned thing on the journal and no-one in my university has any experience on the JMS whilst I'm a very ordinary html-er with no real php or other programming skills...

cheers -- and thanks in advance
shiralee
Shiralee
 
Posts: 11
Joined: Tue Aug 05, 2008 12:52 am

Re: cross link html pages?

Postby ephramz » Mon Aug 17, 2009 3:28 am

I want to do something similar but have the standard article URLs like
http://www.ethnobotanyjournal.org/ojs/i ... ew/132/117
be linked to the more human and externally intelligible URL like
http://www.ethnobotanyjournal.org/vol5/ ... 05-233.pdf
made up of the journal ISSN- volume- starting page
is this possible?

Where is the Public ID documented? I can't find it on the sfu.ca technical documentation
ephramz
 
Posts: 7
Joined: Mon Aug 17, 2009 2:18 am

Re: cross link html pages?

Postby jmacgreg » Tue Aug 18, 2009 2:41 pm

Hi ephramz,

There isn't yet a full document on using public IDs, and there really should be -- I'll see about getting one together in the next little while. Meantime, the basics are as so:

1) enable Public Identifiers in Journal Setup 4.3
2) ensure that you have assigned a Public ID for: the issue; the article; and the article galley in question.
-- Issue identifiers can be set by the editor, in Issue Data;
-- Published Items identifiers can be set from the Issue Table of Contents page;
-- Galley identifiers can be set during the galley upload/edit process (that's from the submission's Editing page).

If you've set those, you can then point to the following:

/index.php/myJournal/issue/Spec1 -- will take you to the issue identified as 'Spec1' in Issue Data;
/index.php/myJournal/article/view/macgregor -- will take you to the article page identified as 'macgregor' in the issues' ToC page (note that this will take you to the article's abstract or details page -- not to a galley);
/index.php/myJournal/article/view/macgregor/pdf -- will take you to the PDF galley of the article 'macgregor' if you have specified the Public ID 'pdf' for that specific galley. You could specify 'macgregor.pdf' if you wanted to make it look like a PDF file -- but note that this won't actually change the name of the file that's downloaded.

Cheers,
James
jmacgreg
 
Posts: 4182
Joined: Tue Feb 14, 2006 10:50 am

Re: cross link html pages?

Postby mj » Tue Aug 18, 2009 4:36 pm

Hi all,

Just to add to James' extensive comments -- if you're looking to do some URL translation, you may want to consider the discussion on mod_rewrite in this thread. A word of caution, however: mod_rewrite can be somewhat challenging and complex for those who haven't worked with it before.

MJ
mj
Site Admin
 
Posts: 304
Joined: Fri Mar 26, 2004 9:32 am
Location: Toronto, Canada

Re: cross link html pages?

Postby ephramz » Wed Aug 19, 2009 3:15 am

Thanks for the response jmacgreg.

I guess there's no way to eliminate the /ojs/index.php part of the URL with OJS's built in functions, is there? Would I have to do that with a RewriteRule in my .htaccess site file for each individual article?

Also something very strange is happening with URL's and frames I do not understand that might prevent me from doing such low level redirects: when I navigate through the OJS structure to an article from our journal homepage I get to the article fine and arrive at a URL such as
http://www.ethnobotanyjournal.org/ojs/i ... ew/132/117
But then if I copy and paste this URL into another browser window it just loads our journal homepage as if I'd typed
http://www.ethnobotanyjournal.org/
I've tried this both in Safari and Firefox on a Mac

Is this due to the frames, and is there a way to point directly to the PDF without the frame to get around this? I didn't see anything about frames in the technical manual.
ephramz
 
Posts: 7
Joined: Mon Aug 17, 2009 2:18 am

Re: cross link html pages?

Postby mj » Thu Aug 20, 2009 1:04 pm

Hi ephramz,

I guess there's no way to eliminate the /ojs/index.php part of the URL with OJS's built in functions, is there? Would I have to do that with a RewriteRule in my .htaccess site file for each individual article?


You will have to have mod_rewrite enabled and an .htaccess RewriteRule in order to do this. OJS 2.3 will have an option in config.inc.php to make this configuration a bit easier, but it is doable with a small change to the current version -- as outlined in that forum thread. You only need one rule for the entire site, including all articles.

Also something very strange is happening with URL's and frames I do not understand that might prevent me from doing such low level redirects: when I navigate through the OJS structure to an article from our journal homepage I get to the article fine and arrive at a URL such as
http://www.ethnobotanyjournal.org/ojs/i ... ew/132/117
But then if I copy and paste this URL into another browser window it just loads our journal homepage as if I'd typed
http://www.ethnobotanyjournal.org/
I've tried this both in Safari and Firefox on a Mac

Is this due to the frames, and is there a way to point directly to the PDF without the frame to get around this? I didn't see anything about frames in the technical manual.


This doesn't have anything to do with frames, since it still seems to happen with frames turned off. You'll have to take a closer look at your RewriteRules and make sure that you're not doing internal rewrites for all URLs (which it looks like it's doing at present). Again, be very careful and methodical with using mod_rewrite, and do lots of research. It can become very complex and frustrating very quickly if you start making big changes without a lot of experience.

MJ
mj
Site Admin
 
Posts: 304
Joined: Fri Mar 26, 2004 9:32 am
Location: Toronto, Canada


Return to OJS Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron