OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Template documentation

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.

Template documentation

Postby soj » Wed Nov 02, 2005 3:02 pm

It'd be great to have some documention/explanation of template layouts and css for those of us who would like to modify them somewhat but are not experts in php or css.

For instance, an option for a left hand sidebar navigation area would be useful.

If such docs exist, I'd be grateful for a heads up.

Awesome effort otherwise. Cheers!

soj
soj
 
Posts: 151
Joined: Fri Oct 28, 2005 1:53 pm
Location: Norman OK USA

Postby asmecher » Thu Nov 03, 2005 9:59 am

Hello Soj,

You should be able to add features such as a left-hand sidebar without knowledge of PHP, although you'll need to know CSS and, of course, HTML. OJS uses the Smarty template system to separate content from code; see the Smarty website (http://smarty.php.net) for more information.

The tricky part will be determining which template is being displayed if you want to modify a specific page. To find the handling code, see the OJS Technical Reference (http://pkp.sfu.ca/ojs/OJSTechnicalReference.pdf) on page 10-11; the last function call in the handling code will most often indicate the template being used.

If you'd like to add a left-hand sidebar throughout the site, templates/common/header.tpl is the best template to change. I'd suggest putting your additional code in a separate template file and using a Smarty {include file="..."} call in header.tpl to bring it in. This will make OJS upgrades easier.

Regards,
Alec Smecher
Open Journal Systems Team
asmecher
 
Posts: 8453
Joined: Wed Aug 10, 2005 12:56 pm

Postby soj » Thu Nov 03, 2005 10:12 am

Sweet. Brilliant, too - incorporating an exisiting template system. I will manage the CSS and will investigate Smarty Templates. Very glad to hear there's more documentation out there. I looked at Smarty in conjunction with TYPO3. Wound up immersed with MovableType instead.

Y'all know you're changing the world, right? THANKS. soj
soj
 
Posts: 151
Joined: Fri Oct 28, 2005 1:53 pm
Location: Norman OK USA

Can't change templates

Postby akhi003 » Tue Nov 22, 2005 11:29 am

Is there anything special that needs to be done to change the template files? For instance, I am trying to modify the menu (templates/common/header.tpl). Every time I make a change and go and view the changes, nothing happens. I have even deleted the entire contents of the header.tpl file and everything shows up as normal, even though an error should be returned.

Any ideas? I was thinking that possibly I am in the wrong place, but I do not know of any other place to look in. (I am under templates/common/)

Nabeel
akhi003
 
Posts: 11
Joined: Tue Nov 15, 2005 3:07 pm

Postby asmecher » Tue Nov 22, 2005 12:53 pm

Hi Nabeel,

You should be able to modify the templates directly like you've been doing -- most likely the problem is the compiled template cache getting in the way. Ensure that the web server has sufficient permissions to manage the files in templates/t_compile, and if that doesn't correct the problem, flush the template cache (the Site Administrator has access to this function).

Regards,
Alec Smecher
Open Journal Systems Team
asmecher
 
Posts: 8453
Joined: Wed Aug 10, 2005 12:56 pm

Postby akhi003 » Wed Nov 23, 2005 10:04 am

Seems like I had some permission issues. I changed them, flushed the template cache, and everything is good to go. Thanks for the assistance, Alec.

Nabeel
akhi003
 
Posts: 11
Joined: Tue Nov 15, 2005 3:07 pm


Return to OJS Development

Who is online

Users browsing this forum: No registered users and 1 guest