Template customization question

Hi @arielnoname,

Sorry for the late reply. I’m going to try to answer some of your questions:

  • OJS uses Smarty v2 (documentation is here: http://www.smarty.net/docsv2/en/).

  • A good resource but maybe a bit technical is OJS Doxygen: https://pkp.sfu.ca/ojs/doxygen/stable/html/index.html There’s info about OJS classes, modules and packages.

  • Files in ojs > lib > pkp > templates are like the bones. Usually you can focus on files stored in lib > pkp > templates > common. There you can modify your header, your footer, etc.

  • Then you have the ojs > templates folder. Most of tese .tpl files are blocks of content displayed inside the main content on pages. From my experience, the best way to keep track of your changes and not work so much when upgrading is the one indicated by Alec here: Multiple templates directories - #3 by andymp
    This way you’ll have a separate directory where you can store all your modified .tpl files. I was upgrading our installation from 2.4.2 to 2.4.6. so I’ve already done this and it’s pretty easy. You can see the final result and the link to GitHub in this post: OJS 2.4.6 + BS + FontAwesome + Google Fonts + 2 plugins
    I can help you to replicate this I you want.

  • Homepage rendering process: roughly it works this way. Take a look at templates > index > site.tpl. In this file, you have two lines of codes

  • line 15: {include file=“common/header.tpl”}

  • line 55: {include file=“common/footer.tpl”}
    So when you visit your homepage (if there’s more than 1 journal) site.tpl is loaded and it calls lib > pkp > templates > common > header.tpl and footer.tpl, whose content is included.

  • And maybe the most important thing. As far as I know OJS 3.0 template handling is completely different, much easier to customize and mantain in future upgrades. Haven’t tried yet because I was upgrading but now I’m going to start with OJS 3.0 tests. So maybe it’s a better option if you want to fully modify OJS, even if it’s a development release. It’s up to you.

Hope this helps, cheers,
Andy

1 Like