OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Add an image map on the image header

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

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

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

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.

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 OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Add an image map on the image header

Postby eXcer » Sat Dec 29, 2007 11:48 am

Hi there!

I wanted to add an image map on the image header of the OJS site (to do the same as the link on the phpBB image on the top left corner of this site! ;) ), so the users could click on an image area (that is a logo) to jump to another site. Where can I add the code to do it? Only on the common.css file? Don't I have to add some code on the HTML file too?

Thanks in advance for all the help!
eXcer
 
Posts: 22
Joined: Wed Jun 27, 2007 5:07 pm
Location: Portugal

Re: Add an image map on the image header

Postby jmacgreg » Sat Dec 29, 2007 3:38 pm

Hi eXcer,

You can upload both image headers and a logo for your journal, but they won't be hyperlinked to anything. You can modify the header file to add a link though -- I'll show you in a sec.

Your best bet is to first upload the images you want. You can do this in Journal Setup Step 5. You can upload both a logo (which should be smaller, similar to our phpBB logo) which will float to the left, and if you like a header banner, which will replace the journal name text. Please make sure that you've uploaded these items for both the home and journal-level pages, if you want them to appear in both locations (that is, repeat steps for 5.1 Journal Homepage Header AND 5.3 Journal Page Header.

Next, to add the link you'll have to manually edit the header template file, found at templates/common/header.tpl.

To make the logo image a link, it would be something like this:

Code: Select all
<div id="headerTitle">
<h1>
{if $displayPageHeaderLogo}
        <img
src="{$publicFilesDir}/{$displayPageHeaderLogo.uploadName|escape:"url"}"
width="{$displayPageHeaderLogo.width|escape}" height="{$displayPageHeaderLogo.height|escape}" style="border: 0;"
alt="" />
{/if}


to

Code: Select all
<div id="headerTitle">
<h1>
{if $displayPageHeaderLogo}
        <a href="linkurl"><img
src="{$publicFilesDir}/{$displayPageHeaderLogo.uploadName|escape:"url"}"
width="{$displayPageHeaderLogo.width|escape}" height="{$displayPageHeaderLogo.height|escape}" style="border: 0;"
alt="" /></a>
{/if}


Of course, you'll want to change 'linkurl' to the proper link.

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

Re: Add an image map on the image header

Postby eXcer » Sat Dec 29, 2007 4:05 pm

Hey, thanks alot for the help...

I have to edit my header image then, because I have the logo and the journals title on the same image! :D I'll do what you've said and I'll say something if it didn't went ok...

Thank alot for keep helping me out! ;)

UPDATE: Worked great... the minor thing is the underline that appears under the image (because of the CSS to the links). Thanks for the help James! 8)

UPDATE 2: Is there a way to override the CSS code to the mouse over underline effect on the logo, so the underline doesn't appear when the mouse is over the logo image? I'm trying to add this piece of code before the image link code (mentioned on previous posts):

<style type="text/css">a:hover{border-bottom: none;}</style>

but it gives me a "syntax error: unrecognized tag: border-bottom:none; (Smarty_Compiler.class.php, line 438)". Any suggestions? :)
eXcer
 
Posts: 22
Joined: Wed Jun 27, 2007 5:07 pm
Location: Portugal

Re: Add an image map on the image header

Postby eXcer » Mon Jan 07, 2008 8:51 am

Hi there!

Can anyone help me out with the problem I've mentioned on the "update 2" point on my last post? I've already tried some tricks but nome has worked... I'm missing something... :?

Many thanks in advance! ;)

eXcer
eXcer
 
Posts: 22
Joined: Wed Jun 27, 2007 5:07 pm
Location: Portugal

Re: Add an image map on the image header

Postby jmacgreg » Mon Jan 07, 2008 12:06 pm

Hi eXcer,

The OJS Smarty template system reads anything in between curly-braces ({}) as a smarty template tag. Try either adding the css snippet to styles/common.css, or uploading your own css file from Journal Setup Step 5. I'd suggest the latter, for future upgrading issues.

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

Re: Add an image map on the image header

Postby eXcer » Mon Jan 07, 2008 12:30 pm

Hi James, thanks once again for the help!

Since I just want to remove the underline that appears on the journal's logo when the mouse is over it, perhaps the best choice is to add a new class to override the existing CSS link effect and associate it to the logo's image link, what do you think?

Thanks for feedback! :)

eXcer
eXcer
 
Posts: 22
Joined: Wed Jun 27, 2007 5:07 pm
Location: Portugal

Re: Add an image map on the image header

Postby jmacgreg » Mon Jan 07, 2008 3:53 pm

Hi eXcer,

That'd work, but just off the top of my head I think you could also do something like

#headerTitle a:hover
{
text-decoration: none;
}

Or some-such. No real need to add a new class, I don't think. I'm a little hazy with my css rules, so you may have to test out a variation or two. Maybe try replacing 'a:hover' with just 'a', or possibly even 'h1' if that doesn't work.

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

Re: Add an image map on the image header

Postby eXcer » Tue Jan 22, 2008 12:03 pm

Hi there James...

First of all, sorry for the late reply, but I've been away for some days... I'll try to edit the CSS to manage that "underline problem"!

Thanks for the tip! ;)
eXcer
 
Posts: 22
Joined: Wed Jun 27, 2007 5:07 pm
Location: Portugal


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests