You are viewing the PKP Support Forum | PKP Home Wiki

Main Page Customization

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.

Main Page Customization

Postby pkpyam » Wed Dec 05, 2012 7:32 pm

Searched and did not find an answer to this. If it exists, I missed it (so, sorry!).

Where do I find the OJS homepage template/theme for customization and a few text changes? Can anyone send me the path?

Thanks! :)
Posts: 1
Joined: Sat Dec 01, 2012 1:16 pm

Re: Main Page Customization

Postby Garant » Sun Jan 13, 2013 7:12 am

Having the same question.
I'll make my question a bit clearer, here, at demo: http://pkp.sfu.ca/ojs/demo/present/inde ... ndex/index
We can find the main page with the list of journals.
I want to modificate this template. So I haven't found which one belongs to it.
And one more thing - I need to add a custom css only for this "area": for journals list page with all its pages(Home,About, Log In and so on), but this css should not interfere with any other journal css.
How can I make it? Load it in its own template?
Thank you!
P.S. I've found the templates: they are put in "user" and "index" folders. But still can't figure out how to load separate css only for this modules with smarty syntax... OR should I write a plugin ?
Posts: 238
Joined: Wed May 30, 2012 8:53 am

Re: Main Page Customization

Postby Garant » Fri Jan 18, 2013 6:11 am

Made a hack with JS:
Code: Select all
    <script type="text/javascript">{literal}
       var loc = window.location;
       var currentURL = loc.pathname;
       if (currentURL=='/ojs/index' || currentURL=='/ojs/' || currentURL=='/ojs/about' || currentURL=='/ojs/user/register')
        loadjscssfile("/ojs/styles/images/main_page_style.css", "css")
    function loadjscssfile(filename, filetype){
     if (filetype=="css"){
      var fileref=document.createElement("link")
      fileref.setAttribute("rel", "stylesheet")
      fileref.setAttribute("type", "text/css")
      fileref.setAttribute("href", filename)
     if (typeof fileref!="undefined")

But it's not a real solution. It would be great in future to make a possibility to customize the main page and also add classes to published elements.
Posts: 238
Joined: Wed May 30, 2012 8:53 am

Re: Main Page Customization

Postby JasonNugent » Fri Jan 18, 2013 10:43 am

HI Garant,

You can do what you want to do with a plugin. A 'generic' plugin that hooks against TemplateManager::display would have a chance to call addStyleSheet() on the template manager variable before the template was shown. You'd just have to test for the specific template you wanted. Have a look at the addStyleSheet() method in lib/pkp/classes/template/PKPTemplateManager.inc.php.

Site Admin
Posts: 910
Joined: Tue Jan 10, 2006 6:20 am

Re: Main Page Customization

Postby Garant » Fri Jan 18, 2013 10:55 am

Hi JasonNugent!
Thank you for your answer!
Sound like a good solution. I will try to write a plugin for this purpose.
So the plugin could consist of a one function which will check for specific template and if that criteria will be met - call addStyleSheet() method?
Posts: 238
Joined: Wed May 30, 2012 8:53 am

Return to OJS Development

Who is online

Users browsing this forum: No registered users and 2 guests