ZenphotoCMS Forum
Use Gallery and Image Descriptions for search engines (meta) - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Use Gallery and Image Descriptions for search engines (meta) (/thread-4706.html)



Use Gallery and Image Descriptions for search engines (meta) - boo - 2009-02-18

Hi,
We want to use the album and image descriptions for the page meta description.

ie:

<meta name="description" content="<?php echo printImageDesc(); ?>" />
<meta name="description" content="<?php echo printAlbumDesc(); ?>" />

Is this the correct method and do we need to format them to remove line breaks etc ?

Many thanks.


Use Gallery and Image Descriptions for search engines (meta) - acrylian - 2009-02-18

First, functions with a beginning "print" already echo themselves...Smile The ones starting with "get" need to be echoed.
For meta tags you better use the "getBare" functions (see the doc). These already strip html tags etc. from the content to be used in img alt or title tags.


Use Gallery and Image Descriptions for search engines (meta) - boo - 2009-02-18

Hi, ok great!

Have used: <meta name="description" content="<?php echo getBareAlbumDesc(); ?>" />

If I view source there is a line break as below,

<meta name="description" content="Photographing birds is not only a challenge but a real pleasure. Gives you a chance to study hehaviour, bird calls
and much more.
You just need lots of patience and a flask of coffee at the ready." />

Is that just whitespace in the text, sorry just need to check.

Pat


Use Gallery and Image Descriptions for search engines (meta) - acrylian - 2009-02-18

Actually it should strip all tags, it might be that a invisible linebreak got through. I don't think this harms.


Use Gallery and Image Descriptions for search engines (meta) - boo - 2009-02-18

Hi, ok will wait and see how it looks on the search engines.

Thankyou for your support!

Pat