Dynamic meta ? Dynamic meta ?
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Dynamic meta ?

Started by antisa33, April 10, 2005, 08:07:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

antisa33

Hello, I have seen in theme.php the line
function pageheader($section, $meta = '<meta name="keywords" content="test">')
I would like to put <meta name="keywords" content="$my_gal_title"> but it's incorect  and my_gal_title is a function, how to put the result of my_gal_title in the $meta keywords ?
In meta name="description" i would like to put the album name, i tried with {GAL_NAME} in content= but it don't want, the syntax is incorect.
What syntax to put ?
Thank you for your help !
Isa

antisa33


antisa33

How can i wrote

function pageheader($section, $meta = '<meta name="Description" content="$description"><meta name="keywords" content="colorier">')
{

how to add $description ?

Thank you !!
Isa

antisa33


Abbas Ali

If you want that meta keywords should always be your gallery title then....

Edit themes/yourtheme/theme.php

Add


$meta = "<meta name=\"keywords\" content=\"".$CONFIG['gallery_name']."\">";


just after


function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;


I didn't understand the second part of your question...


Abbas

P.S: Finally someone replied to you after almost a year :).
Chief Geek at Ranium Systems

antisa33

#5
Thank you for your reply !!
I have dynamic meta but, i cant have this in dynamic when i go on the thumbnails view :
<meta name="Description" content="
How can i have <meta name="Description" content="$title of abum"
when i go on the thumbnails view of an album (here thumbnails.php?album=5 for example)  ?
Thanks a lot !!!!
:)

antisa33

Thank for the line, i understand it is good.

$meta = "<meta name=\"keywords\" content=\"".$CONFIG['gallery_name']."\">";

Now in description meta : can i have the current album_title ? I try

<meta name=\"Description\" content=\"".$CURRENT_ALBUM_DATA['title']."

but in thumbnails.php it dont know $CURRENT_ALBUM_DATA['title']

Why cant i use this tag ?

Thank you

Abbas Ali

Hmmm.... remove the above mentioned mod (i.e. undo the changes mentioned above) and then do the following changes.

Edit thumbnails.php

Replace


pageheader(isset($CURRENT_ALBUM_DATA) ? $CURRENT_ALBUM_DATA['title'] : $lang_meta_album_names[$album]);


with


$meta = "<meta name=\"keywords\" content=\"".$CONFIG['gallery_name']."\">\n<meta name=\"description\" content=\"".(isset($CURRENT_ALBUM_DATA) ? $CURRENT_ALBUM_DATA['title'] : $lang_meta_album_names[$album])."\">";
pageheader(isset($CURRENT_ALBUM_DATA) ? $CURRENT_ALBUM_DATA['title'] : $lang_meta_album_names[$album], $meta);


then edit displayimage.php

Replace


    if ($CURRENT_PIC_DATA['keywords']) { $meta_keywords = "<meta name=\"keywords\" content=\"".$CURRENT_PIC_DATA['keywords']."\">"; }


with


    if ($CURRENT_PIC_DATA['keywords']) { $meta_keywords = "<meta name=\"keywords\" content=\"".$CURRENT_PIC_DATA['keywords']."\">\n<meta name=\"description\" content=\"".(isset($CURRENT_ALBUM_DATA) ? $CURRENT_ALBUM_DATA['title'] : $lang_meta_album_names[$album])."\">"; } else {
      $meta_keywords = "<meta name=\"keywords\" content=\"".$CONFIG['gallery_name']."\">\n<meta name=\"description\" content=\"".(isset($CURRENT_ALBUM_DATA) ? $CURRENT_ALBUM_DATA['title'] : $lang_meta_album_names[$album])."\">";
    }


By doing above modifications meta keywords and meta description will be shown on thumbnails page and intermediate pic page as you wanted.


Abbas
Chief Geek at Ranium Systems