PDA

View Full Version : How to add thread title into IMG ALT Tag


jiggle
05-18-2010, 12:56 PM
Hi,
I am using vBulletin 3.7.x and want to add an img alt tag to all my images. At the moment the postbit_attachmentimage shows

alt=""

I want to add the thread title and the filename of the image.
So I change the postbit_attachmentimage to:

alt="$attachment[filename]"

This works. But I was not able to add the thread title to the ALT Tag. I tried $thread_title, but this does not work.
Is someone able to help please ?
I want to optimize my images for google images and an alt="" is not very good for google :-)

Many thanks and best regards
Andy

jiggle
05-20-2010, 12:02 AM
*push*

Lynne
05-20-2010, 03:22 AM
Look up the function process_attachment. That is where the template gets rendered. You can see that there is no thread information passed to the function. $post is passed, so you may be able to go backwards to where that function is first called and slip the thread title into a post variable so it gets passed.

jiggle
05-21-2010, 10:19 AM
Hi Lynne,
thanks for your posting. I am not familiar with php coding. Do you have a clue how to include this the thread title into the template ?
Many thanks in advance for your help.

Lynne
05-21-2010, 01:49 PM
I told you what I know. You will have to do some coding in order to get this to work for you. The information is not currently available for you to use.