OJS 2.4.8-1 "View Journal" link

Hello everyone,

I asked a question and was able to get a very succinct answer so I thought I would pick the brains of everyone once more.

The department that we host the journal for using OJS requested a change in the link on the Index page that’s listed as “View Journal”. On our front end of the system, which I can include as an uploaded image, there are three links that mention “View Journal/ Current Issue/ Register” and the change that they’re requesting is that the link for “View Journal”, instead of linking to “index.php/character/”, linking to our “index.php/character/issue/archive” section so that the previous issues of the journal are also shown.

The issue is that I don’t know where to look in the system files to find where I need to change the information and also don’t know if it’s possible to adjust that link in the setup. I hope someone can assist me in this.

Thank you.

Hi @charlescmyers,

You’ll need to edit a template to get this behavior – specifically, templates/index/site.tpl. Note that if you’re hosting several journals, changes you make to that template will potentially affect them all.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I found the referenced line where it says

<a href="{url journal=$journal->getPath()}" class="action">{translate key="site.journalView"}</a>

but I’m not sure exactly how to adjust that to view, instead of the "site.journalview", the Archived page of issues that we have. Since we only host the journal on behalf of another department here, I’m not worried about it affecting other journals. What I thought of changing it to would be:

<a href="{url journal=$journal->getPath()}" class="action">{translate key="site.journalArchive"}</a>

Thank you again for all your help.

Note that the anchor tag’s href is formed by the smarty {url} function. This is what created the URL for the hyperlink. If you look at the navbar, which already creates the link to the archives, you will find the remaining url parameters:

Hi @ctgraham,

If I understand correctly, that means that the change I would make for the end piece of the href tag would actually be the

<a href="{url page="issue" op="archive"}">{translate key="navigation.archives"}</a>

piece that you highlighted correct? Would I then just replace the original link information that I posted, after the href tag, to this?

Thanks for your help in understanding this.

Almost. Note that in the navbar.tpl, this code is constrained only when there is a current journal in context. In the sample from site.tpl, the journal is explicitly named. You’ll need to continue to pass the journal parameter as well.

Hi @ctgraham,

If I understand what you mean by the journal parameter, you’re referring to the

<a href="{url journal=$journal->getPath()}

of the piece that I initially posted. Looking between the two, I can see that it’s pulling directly from the journal on the site.tpl, which would mean that I have to change the first part of that line as well to look something like

<a href="{url journal=$currentjournal->getPath()}" class="action">{translate key="navigation.archives"}</a>

Did I understand what you meant by journal parameter? If I wrote it out wrong, my apologies. As I mentioned before, I’m learning this all right now.

Thank you.

Yes, the {url } function takes multiple parameters, including journal=, path=, op=, etc.

In site.tpl, your don’t have a variable $currentJournal to work with. Rather, each journal is iterated as the variable $journal, so the start of the {url } call will not change. You will need to add the additional desired parameters of path= and op=, to change the URL to the journal/issue/archive URL.

Hi @ctgraham,

Ok, that makes sense. With that in mind, would I need to change the class="action" piece as well? I think I get what you mean as well, so it would look more like this

<a href="{url journal=$journal->getPath() page="issues" op="archive" }" class="action">{translate key="site.journalView"}</a>

I keep thinking, though, that the translate key="" should also be changed. In the referenced field for the archives in the navbar.tpl it’s pointing to the archives. Am I wrong in thinking this?

Thank you.

The class="action" is part of the CSS styling. I would presume you would want to keep it, but this is arbitrary with respect to the link function.

The anchor tag (a) contains the text which is used for the hyperlink. This text is translated from the locale files. Depending on what you want the link text to be, your could leave or change the {translate key}. Here is the English site.journalView text vs. the navigation.archives text:

Hi @ctgraham and @asmecher,

Thank you both for the wonderful guidance and patience. I was able to get the code working as needed this morning and it ended up looking like this:

<a href="{url journal=$journal->getPath() page="issue" op="archive"}" class="action">{translate key="site.journalView"}</a>

I kept the link name the same after changing it, since that’s what the person who produces the journal mentioned to me. I ended up using the other links on the page as reference as well, seeing how it pulled the information and finally was able to link to the right page this morning. It seems so easy now, after looking at all the time it took to understand what I was actually doing.

Thanks again for your help.