PDA

View Full Version : Headlines Image


timob
01-11-2007, 04:22 PM
I am using 3.4, when at the home page what I tend to do is click on the image to go to the headline article, by the time I realize that is not going to take me there that I need to click on "full stoy" it rotated to the next headline and I am now on the next one, I do this at least once a day.

I would really like to change this so that when you click on the image that you go to the story. Can this be done easily?

Alex
01-11-2007, 05:31 PM
"Full story" is not the only clickable area, you can click on the title as well (which seems like a more logical solution to me :)).

Anyhow, here's how to make image in headline clicklable:

Edit /templates/headlines.tpl, and wrap IMG tag with <a href="{LINK}">

Here's how to do it:

instead of:

<img id="headline_image" src="{ROOT}files/{IMAGE}" align="left" border="0" alt="image" />
place this:

<a href="{LINK}">
<img id="headline_image" src="{ROOT}files/{IMAGE}" align="left" border="0" alt="image" />
</a>


Hope this helps.

themx
01-12-2007, 04:47 AM
it seems that this doesn't work, because every picture links to the newest news.

shketuljko
01-12-2007, 04:40 PM
OK, let see!

* 1st you must change template file templates/headlines.tpl

this line:
<img id="headline_image" src="{ROOT}files/{IMAGE}" align="left" border="0" alt="image" />

you need to replace with:
<a id="headline_image_link" href="{LINK}"><img id="headline_image" src="{ROOT}files/{IMAGE}" align="left" border="0" alt="image" /></a>

** 2nd you must change template file templates/headlines.xml.tpl

this line:
<image src="{ROOT}files/{IMAGE}"/>

you need replace with:
<image src="{ROOT}files/{IMAGE}" href="{LINK}"/>

***3td you must change javascript file include/ajax.js
after 103 line:
var headline_link = document.getElementById('headline_link');

you must put this code:
var headline_image_link = document.getElementById('headline_image_link');

and

after 120 line:
headline_image.setAttribute('src', node.getAttribute('src'));

you must put this code:
headline_image_link.setAttribute('href', node.getAttribute('href'));


This is everything for make image link in headlines.

themx
01-12-2007, 06:38 PM
Now it works, thanks a lot shketuljko!

timob
01-13-2007, 05:23 AM
Thanks, this is awesome, should just be a default feature works very nice!

amirdoit
01-13-2007, 03:33 PM
nice work. how can we add news headline as Image alt text

Alex
01-13-2007, 07:26 PM
Thanks, this is awesome, should just be a default feature works very nice!
yep, suppose we could :)

GusLinares
02-13-2007, 09:49 AM
Hi,

Have tried the above and works great on IE.

However there seems to be a problem when using Firefox, all headline image URLs appear as

http://www.vox.gi/index.php?news=1866&PHPSESSID=0625a9853107ee48a049913ecf332272

instead of article's URL and onclick on any headline image will take you to the same headline page (1866) in this case.

Any ideas?

shketuljko
02-14-2007, 09:41 AM
When i made this feature (or customization anyhow), i was working on MOZILLA Firefox 2.0 and tested this many times.
Everything seems to be working fine.

Please provide more specific example.

Elton
03-10-2007, 08:16 AM
I tried this today, but just couldn't get it to work. All sorts of strange happenings :(

I'm wondering if it's because I've used Vivvo from the beginning and my 'version' is a bit of a mish-mash of upgrades, rather than a nice, clean, up-to-date version :(