You are viewing the PKP Support Forum | PKP Home Wiki

Add Logos to Sponsor Details (PATCH)

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.

Add Logos to Sponsor Details (PATCH)

Postby spatialguru » Tue Jun 10, 2008 12:20 pm

Following from a discussion here: http://pkp.sfu.ca/support/forum/viewtopic.php?f=3&t=2368&p=11652#p11652 I've dug into the code and generated a very simple patch for 2.1. Hopefully this isn't redundant with new features in the CVS, but it sure helped me understand simple parts of the code. Think this will port back to 2.0 easily?

What this does
  • Adds Logo Image element to the schedConf Step 1 details forms for each Sponsor. A URL to an image.
  • Displays the image beneath the sponsor name on the About - Organising Team page.

The patches..
It's really only done by adding 7 simple lines, mostly cloned and modified from other existing lines! Don't be afraid :)

Code: Select all
--- templates/manager/schedConfSetup/step1.tpl.orig     2008-06-10 13:35:01.000000000 -0400
+++ templates/manager/schedConfSetup/step1.tpl  2008-06-10 14:52:14.000000000 -0400
@@ -178,6 +178,10 @@
                <td width="20%" class="label">{fieldLabel name="sponsors-$sponsorId-url" key="common.url"}</td>
                <td width="80%" class="value"><input type="text" name="sponsors[{$sponsorId|escape}][url]" id="sponsors-{$sponsorId|escape}-url" value="{$sponsor.url|escape}" size="40" maxlength="255" class="textField" /></td>
+        <tr valign="top">
+                <td width="20%" class="label">{fieldLabel name="sponsors-$sponsorId-logourl" key="manager.setup.layout.useImageLogo"}</td>
+                <td width="80%" class="value"><input type="text" name="sponsors[{$sponsorId|escape}][logourl]" id="sponsors-{$sponsorId|escape}-logo" value="{$sponsor.logourl|escape}" size="40" maxlength="255" class="textField" /></td>
+        </tr>
        {if !$smarty.foreach.sponsors.last}
        <tr valign="top">
                <td colspan="2" class="separator">&nbsp;</td>

  • A couple questions here.. could I use a better key for the label? Ideally it'd also say "URL" but I wasn't sure how to concatenate two items in a key. I also didn't want to add anything to locale files.
  • Is logourl an okay variable name to use? I kept it as simple as a I could and hoped to not overlap usage in other places.
Code: Select all
--- templates/about/conferenceSponsorship.tpl.orig      2008-06-10 14:53:23.000000000 -0400
+++ templates/about/conferenceSponsorship.tpl   2008-06-10 15:04:51.000000000 -0400
@@ -34,6 +34,9 @@
+               {if $sponsor.logourl}
+                       <li style="list-style-type:none"><a href="{$sponsor.url|escape}"><img src="{$sponsor.logourl|escape}"></a></li>
+               {/if}

Note in the last snippit, I inserted the logo as a list item, but set the style to none, so no bullet would be shown. I'm not sure if I should hardcode this or refer to an existing style class. Any suggestions?

What I want to do next
Last edited by spatialguru on Thu Jun 26, 2008 2:36 pm, edited 1 time in total.
Posts: 112
Joined: Mon Jun 25, 2007 1:23 pm
Location: British Columbia, Canada

Re: Add Logos to Sponsor Details (PATCH)

Postby spatialguru » Wed Jun 18, 2008 2:22 pm

With the stylesheet I was using on our site, I got some ugly graphic borders when viewing in Firefox. So I recommend changing this line in the template:

Code: Select all
<img src="{$sponsor.logourl|escape}">
<img src="{$sponsor.logourl|escape}" border="0">
Posts: 112
Joined: Mon Jun 25, 2007 1:23 pm
Location: British Columbia, Canada

Re: Add Logos to Sponsor Details (PATCH)

Postby spatialguru » Thu Jun 26, 2008 2:48 pm

As I started to create the sponsor logo plugin block, I realised I needed a couple more fields for finer control. So I've now added two more fields as well. One for having a smaller or block-appropriate logo, the other for specifying an order/ranking. For example, now you could have a sponsor on the Organising Team page, with a large logo, and a different logo in the block. And you could put your biggest sponsors at the top of the block.

I haven't figured out how to reorder them on the organising team section though. Any hints? Patch file attached, but still testing.

Always open to naming convention, patch generation and UI improvement or standard suggestions. I'm very new at this :)
sponsor logo patch to add 3 new fields to "step1"
(864 Bytes) Downloaded 218 times
Posts: 112
Joined: Mon Jun 25, 2007 1:23 pm
Location: British Columbia, Canada

Return to OCS Development

Who is online

Users browsing this forum: No registered users and 0 guests