You are viewing the PKP Support Forum | PKP Home Wiki

Creating custom template

OCS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, michael

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page. While these are OJS-specific, the OCS codebase is similar enough to OJS they should be of help. There is also an [url=http://pkp.sfu.ca/ocs_documentation[/url]OCS Documentation[/url] page with some more general documentation that might also be of interest.

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 OCS Conference Support and Discussion subforum; if you have a technical support question, try the OCS Technical Support subforum.

Creating custom template

Postby witzawitz » Wed Apr 14, 2010 9:29 am

Hi everyone!
I am trying to create (not modify) my own template in OCS. I know that OCS uses Smarty as template manager and I've tried several ways:

    1. Creating custom template in /templates/ folder using the same structure as in other tpls' folders. This didn't work because I think that it's not enough and requires of course some class structure and php coding.
    2. Creating php script and including neccessary libraries so that script calls template. But there is a problem with including file PhpQuickProfiler.php. I didn't find it in the whole OCS root directory. So the main script somehow uses it but I can't. This way didn't work either. Here is my code
    Code: Select all
        ini_set('include_path', ini_get('include_path') . ':' . '/var/www/<site dir>/lib/pkp/classes/:/var/www/<site dir>/classes/' );

        define ('DIR', dirname(__FILE__) . '/');
        define('INDEX_FILE_LOCATION', __FILE__);
        $t =& TemplateManager()::getManager();

    And I get error
    Code: Select all
    PHP Warning:  require_once(PhpQuickProfiler.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in /var/www/<site dir>/lib/pkp/classes/core/PKPProfiler.inc.php on line 17

    PHP Fatal error:  require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'PhpQuickProfiler.php' (include_path='...') in /var/www/<site dir>/lib/pkp/classes/core/PKPProfiler.inc.php on line 17

    3. Of course I can create static html pages but in this case I can't use the sidebar with user status.

Could anyone please help me?
Posts: 3
Joined: Wed Apr 14, 2010 9:08 am

Re: Creating custom template

Postby jmacgreg » Fri Apr 16, 2010 7:05 pm

Hi witzawitz,

Could you try to describe what you're trying to accomplish? There may be an easier way to do it than to create a new template (and as you've guessed, create a subset of php files behind it). For example, if you only need to create a few custom pages, you could always use the Static Page plugin (in OCS 2.3; under Conference Management -> System Plugins -> Generic; or otherwise available from the Plugin Gallery on this forum). You may also find the OJS Technical Reference handy in explaining how our software is designed.

Posts: 4191
Joined: Tue Feb 14, 2006 10:50 am

Re: Creating custom template

Postby witzawitz » Sat Apr 17, 2010 4:16 am

Oh, thanks a lot.
I've tried to install it manually (but some error has occured) but it's already there I needed only to enable it.
It's what I need. Thanks again.
Posts: 3
Joined: Wed Apr 14, 2010 9:08 am

Return to OCS Development

Who is online

Users browsing this forum: No registered users and 2 guests