OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



template for one conference in a multi conference site

Are you responsible for making OCS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, John

Forum rules
What to do if you have a technical problem with OCS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved. Please note that this FAQ is OJS-centric, but most issues are applicable to both platforms.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a development question, try the OCS Development subforum.

template for one conference in a multi conference site

Postby Dragone » Thu Aug 28, 2008 2:11 am

Hi to all,
I have an OCS 2.1.0.1 installation with actually two conferences.
I have customized the css for each conference and all works
But I would like to change some graphical aspects of each conference which are not in the css.
For example I would like to move the links "home, about,login,search, announcement" in a column on the left of the page, like a menu, and add some links to some external pages.
I would like to transform the layout with all the navigation links on the left and the content of the page in the center, nothing on the right. But I would like to do this only for one conference, not for all the site.
If I change the template, my changes affects all the site.
How can I create a custom template for only one conference?
Thanks in advance for your help
Daniela
Dragone
 
Posts: 45
Joined: Fri Apr 01, 2005 2:21 am
Location: Italy

Re: template for one conference in a multi conference site

Postby mcrider » Thu Aug 28, 2008 6:32 pm

Hi Daniela,

To achieve this, you'll have to do a bit of coding. I would begin by putting conditional comments around the navbar div in templates/common/header.tpl, such that the code only appears for the conference you want to have the navigation bar on top for (something like {if $currentConference->getConferenceId() == 1} ... {/if}).

To make a navigation bar appear for the left side of the page, you'll have to implement this as a block plugin. This is simple enough--Take a look at the 'Developed By' plugin, and just add a few more links (and make any other necessary changes so that the plugin registers as a unique plugin). Then, position it in setup step 4 (and remove anything from the right sidebar).

Let us know if you have any problems...

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: template for one conference in a multi conference site

Postby Dragone » Fri Sep 05, 2008 8:32 am

Thanks!
But how can I do to use different template for different conferences?
Example:
conference A uses templates in the templates dir
conference B uses templates in another dir (not all the files, only, for example, the header.tpl or the footer.tpl)
So, where, in the code, can I say: "use my custom file header.tpl and not the common one"?
I think I can create a theme plugin with my custom css, and put my custom file header.tpl in that dir , but I don't know where, in the code, to say "use this header.tpl and not the common one"
Thanks again
Daniela
Dragone
 
Posts: 45
Joined: Fri Apr 01, 2005 2:21 am
Location: Italy

Re: template for one conference in a multi conference site

Postby hda.lib@cbs.dk » Thu Sep 11, 2008 3:09 am

We have similar problems. But since we plan to run a large number of conferences the "if-else" solution is not a very good idea. A better idea would be to make a kind of "override" system or ini settings, so that you could specify that conference xx should use template x and conference yy template y etc.
Also we would like in general to change a few things in the templates, but this will of course collide with the next upgrade. Is there a simple way to store your changes locally (in our case we want to remove some things in the blocks.tpl in /plugin/blocks/
But in general an override system would be a great thing to have so that you could create your own templates without bothering about upgrade problems - and if you further had a system (e.g. an ini setting so that you could specify which template should be used where - Ok, OK this is a development suggestion.....)
hda.lib@cbs.dk
 
Posts: 16
Joined: Tue May 06, 2008 1:28 am

Re: template for one conference in a multi conference site

Postby mcrider » Thu Sep 11, 2008 2:04 pm

Hi all,

Daniela, you'll have to do a full-text search across your OCS installation and replace all occurrences of {include file="common/header.tpl"} in any template file with something like
Code: Select all
{if $currentConference->getConferenceId() == 1}
     {include file="path/to/alternate/header.tpl"}
     {else} {include file="common/header.tpl"}
{/if}
However, the $currentConference variable isn't available in all those templates, so you would have to find an appropriate alternative (and some of the templates don't have to be modified)

hda.lib@cbs.dk, I understand your desire for greater modularity of templates (like how WordPress works), but that does make upgrading much more difficult. At this point, you would need to use some variant of logical switching. One method that comes to mind is to create separate template directories for each conference with the id of the conference as the directory name, and whenever a template file is included by another template file, attach the current conference id to the path, like
Code: Select all
 {include file="$conferenceId/common/header.tpl"}
.

At this point, whatever changes are made to the templates are going to cause collisions with the next upgrade. I think it would be great to allow for more customization of templates in the future, and it is indeed listed as a suggestion on the OJS roadmap (see http://lib-pkp.lib.sfu.ca/wiki/index.php/OJS), but it may be some time before we have this functionality.

Happy hacking,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: template for one conference in a multi conference site

Postby huu2008 » Mon Oct 27, 2008 5:38 am

Hello,
Can anyone who has managed to customize for one conference in a multiple conferences share with me the idea?.
Thank you in advance
huu2008
 
Posts: 8
Joined: Wed Oct 22, 2008 2:28 am

Re: template for one conference in a multi conference site

Postby tshore » Fri Jan 09, 2009 10:17 am

This feature is essential to my clients. In the past, I have always provided a new colour scheme and header graphics for each year's conference. I am about to embark on that task right now. I am not looking forward to this...
tshore
 
Posts: 264
Joined: Fri Nov 18, 2005 12:48 pm
Location: Hamilton, Ontario

Re: template for one conference in a multi conference site

Postby jmacgreg » Mon Jan 12, 2009 6:12 pm

Hi Trudy,

As Matt mentioned, this is a feature we've discussed, but it hasn't yet been implemented, and I'm guessing won't be in the near future. I have however posted a subset of the thread (and the part that you might find most helpful) as a feature request, which you can see here: http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=3996. Again, this probably won't make it in in the near future, but please take a look, CC yourself for further notifications on the request, and please add comments as you see fit.

Cheers,
James
jmacgreg
 
Posts: 4190
Joined: Tue Feb 14, 2006 10:50 am


Return to OCS Technical Support

Who is online

Users browsing this forum: Google [Bot] and 3 guests