Announcement

#1 2009-06-07 13:00:56

joi
Member
2006-09-24
81

Alt tags

I have been looking around to see if there is an easy way to import image descriptions into the html alt tags, but found nothing. 

Is there a clever way to achieve that?  Such a feature would be very nice, both for the viewers and also help internet search spiders.

Offline

 

#2 2009-06-07 16:17:07

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: Alt tags

Images description may contain:

1 - [lang=default][/lang] and others see [extension by Piwigo Team] Extended Description
2 - other HTML tags: <a href=...


Examples:
1 - http://www.vdigital.org/phpwebgallery/picture?/1924
Description:

Code:

[lang=default]Master of suspense Alfred Hitchcock presents several short stories:<br />“<cite>Good evening, ladies and gentlemen, and welcome to ...</cite>”[/lang]
[lang=fr]Alfred Hitchcock, le maître du suspense présente une anthologie d'histoires courtes<!-- more --> (268 d'après Wikipedia) :<br />“<cite>Bonsoir, je suis Alfred Hitchcock. Ce soir, je vous présente une histoire à suspense; la première d'une série qu'on appelle bizarrement Alfred Hitchcock Présente. Vous ne m'y verrez pas! J'apparaîtrai seulement au début et à la fin ...</cite>”[/lang]

2 - http://piwigo.org/demo/picture.php?/547/category/BestOf
Description:

Code:

<a href="http://www.dailyframe.com/gallery/" onclick="window.open(this.href, ''); return false;"><img style="border: 0px; padding: 15px; background-color: #3f3f3f;" src="http://www.dailyframe.com/gallery/galleries/graphics/dailyframegallery32.png" alt="DailyFrame.com" /><br /><b>Steve Cherry</b></a>

Hello, and thanks for visiting. Steve is a photog with a passion for creating interesting and unique imagery.

How do you want to manage these cases with the alt tag?


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#3 2009-06-07 18:34:28

joi
Member
2006-09-24
81

Re: Alt tags

Hi - the second link you posted (the first requires password) works as I would like to see it, the problem is that the internet search machines don't index outcome of javascript (hence their image caching - correct me if I am wrong).  So instead of having this created for each view it has to exist somewhere for them to find it. 

On a second thought, the whole thing is php, so I guess it is not possible to have permanent alt tag structure as there are no permanent web pages.  Right?

Offline

 

#4 2009-06-07 19:11:25

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: Alt tags

First example link is now public.
The link shows nothing to unaware people.
The most important is the code where you can see English and French but depending on your visitor language,
you will see only one.


Back to your current point.

No.

By php, we can respect a structure, build links and have normalized alt values.
What I tried to show is that currently our descriptions are used with a lot of complex cases, and we can't use this field to build a structured alt.

Anyway, can you give a concrete example of a final description you are expecting?




Note: (2nd example) internet search machines index ignore onclick= but they get href= as any static link.


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#5 2009-06-07 19:35:16

joi
Member
2006-09-24
81

Re: Alt tags

What I originally had in mind was to help the search machines to find the images by having the alt tags in the image path.  That way they identify the description as an image description and would bring the image up in e.g. Google. 

See here:
This link is from a google search: http://tinyurl.com/klongk
Here is the same search, but this time specifically for images: http://tinyurl.com/qjj7ab

The second search results in nothing as the search machine does not realize this is an image description as the alt tag is missing and the image name is cryptic.  Having an alt tag would fix that as I understand the internet search process.

Offline

 

#6 2009-06-07 20:44:48

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: Alt tags

That's clear enough. (Even I am not convinced that alt will change search engine results, but should be tried).

=> We should produce an alt-text only based on [lang= if there is.
Stopped at <!-- more -->
and all html tags removed (strip_tags).

And option should give the selected lang= for alt-text, could be default, or =en (English), or first found [lang=.

Now, the new question is where?
Where? On thumbnail and pictures?


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#7 2009-06-07 20:54:59

joi
Member
2006-09-24
81

Re: Alt tags

Thumbnails would be enough, people could then click their way through to the real image.  That would also have the benefit (that people looking for high resolution images (e.g. image pirates) would find nothing.  The disadvantage would be that not all people looking for high res images are crooks.  Both would probably be best if possible.

Offline

 

#8 2009-06-07 21:58:35

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: Alt tags

We should try to make a plugin... I am full right now.
Anyone can do it?

(Extended description is the basis logic, but no action in admin to code).


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#9 2009-06-08 09:23:41

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: Alt tags

Maybe I found a solution without any pluging.
Let me studying in deeper way before going to code.


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#10 2009-06-08 19:04:00

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: Alt tags

http://piwigo.org/demo/picture.php?/554/category/Europe

Currently, we have:
<img title="Champ de Mars: Just few hours before 2007 Rugby World Cup semi-finals where Jonny holds his nerve to put England in final." alt="IMG_7298.JPG" style="width: 682px; height: 511px;" src="http://albums.piwigo.net/real-VDigital/VDigital/2007-10/IMG_7298.JPG"/>

A very simple way is to flip title= and alt=.
I will explain later the simpliest way to do it.





On thumbnails pages we can do something similar
In a latter time, I will explain how to deal with them.

http://piwigo.org/demo/index.php?/category/Europe

Currently, we have:
<img title="IMG_7298.JPG : 62 Kb" alt="IMG_7298.JPG" src="http://albums.piwigo.net/real-VDigital/VDigital/2007-10/thumbnail/TN-IMG_7298.png" class="thumbnail"/>


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#11 2009-06-08 19:07:11

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: Alt tags

Just you should know that a SEO expert told us to deal in title tag. 

???


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#12 2009-06-08 20:39:25

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: Alt tags

Picture...

If LocalFiles Editor plugin is not already active... Please activate it.

LocalFiles Editor > Tabsheet Templates

Create new file
File name => my-picture_content.tpl                    (for example)

Model => yoga / picture_content.tpl


Inside you will flip title= and alt=.

before:
  <img src="{$SRC_IMG}" style="width:{$WIDTH_IMG}px;height:{$HEIGHT_IMG}px;" alt="{$ALT_IMG}"
    {if isset($COMMENT_IMG)}
        title="{$COMMENT_IMG|@strip_tags:false|@replace:'"':' '}" {else} title="{$current.TITLE|@replace:'"':' '} - {$ALT_IMG}"
    {/if}>
after:
  <img src="{$SRC_IMG}" style="width:{$WIDTH_IMG}px;height:{$HEIGHT_IMG}px;" title="{$ALT_IMG}"
    {if isset($COMMENT_IMG)}
        alt="{$COMMENT_IMG|@strip_tags:false|@replace:'"':' '}" {else} title="{$current.TITLE|@replace:'"':' '} - {$ALT_IMG}"
    {/if}>

And Save file.

And in Admin > Configuration > Templates

Replacers (customized templates)      > my-picture_content.tpl
Original templates      > picture_content.tpl
Optional URL keyword      >     (don't select a keyword)
Bound template > yoga

Submit.



Result:
http://www.vdigital.org/phpwebgallery/p … dens_winks

  <img src="../pwg/galleries/Canon-report/2007-10_St_Ambroix/Canon_PowerShot_S45-2007-10-30_10-20-40.JPG" style="width:600px;height:450px;" title="Canon_PowerShot_S45-2007-10-30_10-20-40.JPG"
        alt="Pomegratate in my garden
" >



Now, we are waiting for a result in (around 15 days or less) :
here

Managing thumbnails is more complex than a simple flip.
;-)

remark: Pomegranate and not Pomegratate (I will correct my website later).
So Google should get it before.

Last edited by VDigital (2009-06-09 16:38:44)


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#13 2009-06-11 12:32:05

joi
Member
2006-09-24
81

Re: Alt tags

This looks like the perfect solution!  Thanks!

Offline

 

#14 2009-06-11 20:28:07

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: Alt tags

Yeh! Maybe but currently google images missed these pics.
Still around 11 days from now to wait.
;-)


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#15 2009-06-11 20:32:52

joi
Member
2006-09-24
81

Re: Alt tags

I am sure it will work :)

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact