OJS 3.1.0.1 - variable containing journal base URL

I’m learning and playing around with a local OJS installation and was wondering if there are any variables that would let me access the journal’s base path inside the .tpl template files? My index page is currently “http://localhost/ojs/index.php/myjournal/index”. Are there any variables that would give me my journal homepage which is “http://localhost/ojs/index.php/myjournal/”? Closest I got was $baseUrl but that just returns http://localhost/ojs/

Hi @jimi

You would need to construct the URL. You could take a look in some templates, e.g. in the lib/pkp/templates/common/header.tpl, to see how some URLs are constructed, e.g. https://github.com/pkp/pkp-lib/blob/master/templates/common/header.tpl#L40

Best,
Bozana

1 Like

I see how it’s working now, I should be able to do it. Thanks for your help!