OJS OCS OMP OHS

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
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.

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! :)
pkpyam
 
Posts: 1
Joined: Sat Dec 01, 2012 1:16 pm

Re: Main Page Customization

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

Hi!
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 ?
Garant
 
Posts: 212
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")
      document.getElementsByTagName("head")[0].appendChild(fileref)
    }

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.
Garant
 
Posts: 212
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.

Regards,
Jason
JasonNugent
Site Admin
 
Posts: 848
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?
Garant
 
Posts: 212
Joined: Wed May 30, 2012 8:53 am


Return to OJS Development

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest