How to change <title> and <metas> at the browser header How to change <title> and <metas> at the browser header
 

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

How to change <title> and <metas> at the browser header

Started by manyquestions, September 15, 2006, 10:23:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

manyquestions

First sorry, for my bad english  ;)

If have a big problem. I upgraded to the new version 1.4.8. and it runs perfect. But one thing is not so nice  ???. Many pix are not indexed by Google because on top of the browser header is standing first the stable "Gallery name" and then comes the META-Tag informations in respectivly "Title" of each the picture.

How can i change these both things. In the blue header of the browser (I.E)  8) should stand first the "Title of the picture" and then the "Gallery name"

Thanks for the solution  :-*

manyquestions

Joachim Müller

1) cpg1.4.8 is not the most recent version there is.
2) edit themes/yourtheme/template.html with a plain text editor and edit the title as you see fit.

twist3r

I need the same thing. In my template.html from water_drop theme in the title area is only <title>{TITLE}</title> . Were is this {title} defined so i can change the way title appears ?

Nibbler


twist3r

But in wich file i can find this function because it`s surley not in theme.php from this water_drop template !?

Nibbler

As with all theme elements, find the function or template you wish to modify in the sample theme, copy it to your custom theme and modify your copy.

manyquestions

Sorry nibbler,

but is it possible to write one or two more sentences for use who are absolute beginners which file we should edit <title>{TITLE}</title> and {META}  ???

Is this possible <title>{META} {TITLE}</title> ???

Thanks for your great help.

manyquestions

manyquestions

Sorry, but now i try it again, and ask nibbler, gaugau and many of the specialists for a little solution. I don´t know why nobody gives us a detailed explanation, who to manage these problems.

O.K. i found the sample-theme and i am not a programmer. Which part should i copy to my theme that the title and the metas can be changed ?

Furthermore GOOGLE doesn´t take my gallery to the GOOGLE-directory because each side has the same "gallery_description". Why could i change this?  ???

Thanks for your help

manyquestions

Sami

copy this function to themes/your theme/theme.php if you didn't have it

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

    $custom_header = cpg_get_custom_include($CONFIG['custom_header_path']);

        $charset = ($CONFIG['charset'] == 'language file') ? $lang_charset : $CONFIG['charset'];

    header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
        header("Content-Type: text/html; charset=$charset");
    user_save_profile();

    $template_vars = array('{LANG_DIR}' => $lang_text_dir,
        '{TITLE}' => $CONFIG['gallery_name'] . ' - ' . strip_tags(bb_decode($section)),
        '{CHARSET}' => $charset,
        '{META}' => $meta,
        '{GAL_NAME}' => $CONFIG['gallery_name'],
        '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
        '{SYS_MENU}' => theme_main_menu('sys_menu'),
        '{SUB_MENU}' => theme_main_menu('sub_menu'),
        '{ADMIN_MENU}' => theme_admin_mode_menu(),
        '{CUSTOM_HEADER}' => $custom_header,
        );

    echo template_eval($template_header, $template_vars);
}

and change the values after '{tiltle}' => & '{META}' => the way you want
‍I don't answer to PM with support question
Please post your issue to related board

manyquestions

Thanks Sami so much. O.K. if put this into my theme, but give me one question more.

Your wrote "and change values after '{tiltle}' => & '{META}' => the way you want??? How, which values should i change that Google gets a perfect header of each gallery-site.

Thanks for your help

manyquestions


Sami

Sorry I'm not SEO specialist ... I think that default setting is good!
‍I don't answer to PM with support question
Please post your issue to related board

manyquestions

O.K. i believe i solved "my" problem.

To change title and meta is very easy, when you know what to do  :-*

I changes the pageheader like that

        '{TITLE}' => strip_tags(bb_decode($section)) . ' - ' . $CONFIG['gallery_name'],
        '{CHARSET}' => $charset,
        '{META}' => $meta,
        '{GAL_NAME}' => $CONFIG['gallery_name'],
        '{GAL_DESCRIPTION}' => strip_tags(bb_decode($section)),
        '{SYS_MENU}' => theme_main_menu('sys_menu'),
        '{SUB_MENU}' => theme_main_menu('sub_menu'),
        '{ADMIN_MENU}' => theme_admin_mode_menu(),
        '{CUSTOM_HEADER}' => $custom_header,

In the next time i test the '{GAL_DESCRIPTION}' => strip_tags(bb_decode($section)), if the code is correct for GOOGLE ;).

Thanks all for the help

manyquestions

bobby131313



QuoteSorry I'm not SEO specialist ... I think that default setting is good!

Actually the title should be switched around.

The title of the page is VERY important for SEO. Most search engines will only index the first 60 characters or so.

This means that if your Gallery name is 30 characters and the album name is 30 characters, then the image name will not get indexed at all with the page that is supposed to be dedicated to the image!

I've switched mine, it will make a difference.  ;)

Just change

        '{TITLE}' => $CONFIG['gallery_name'] . ' - ' . strip_tags(bb_decode($section)),
to

        '{TITLE}' =>  strip_tags(bb_decode($section)) . ' - ' . $CONFIG['gallery_name'],

Works like a charm.

http://www.coincommunity.org/gallery/displayimage.php?album=337&pos=3




Joachim Müller

Google hardly takes the meta tags into account these days btw.

bobby131313


QuoteGoogle hardly takes the meta tags into account these days btw.

You are correct in that the keyword and description metas are not used much anymore by any search engines (because of keyword spammers), however the title tag is absolutely huge and should have any words that deal with the specific page first, not last.


Aeronautic

Hmmm. I've implemented this and have the page title tag working just fine (thanks to those who posted help in this thread).

But I've searched and searched the board as well as my source code and theme code (hardwired) looking for the parameters to set the keyword and description meta tags for the page header.

Right now I've got the static meta tags added to my yourtheme/template.html file but would prefer to use the cat > album > file info to generate both the description and keywords, perhaps with a very short string of static (sitewide) data added at the end as well (and for use alone on the index.php page).

Since I'm using some static meta data I've got duplicate keywords showing (and not sure why there is no duplicate description).

Any help would be appreciated. The CPG install is used to market my stock footage. < - Link to gallery.

Live snip of function code - pretty much what was posted above to flip the title order around...

        '{TITLE}' => strip_tags(bb_decode($section)) . ' - ' . $CONFIG['gallery_name'],
        '{CHARSET}' => $charset,
        '{META}' => $meta,
        '{GAL_NAME}' => $CONFIG['gallery_name'],
        '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
        '{SYS_MENU}' => theme_main_menu('sys_menu'),
        '{SUB_MENU}' => theme_main_menu('sub_menu'),
        '{ADMIN_MENU}' => theme_admin_mode_menu(),
        '{CUSTOM_HEADER}' => $custom_header,


I've searched my code endlessly for {META} and $meta looking for parameters to try.

Thanks!

Aeronautic

PS. I was hoping for a list of parameter variables... but my goal would be to have the file item and album "levels" or pages display the album description text as the meta description value. Same for the categories - each one I have has descriptive text which would be ideal for the meta descriptions.

The file names are not very descriptive and there is no use is using them as source data for the meta data. The file level keywords could be used as they are today but I'd like to tag on a little bit of static text there too.

Many thanks in advance.