Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: How to change <title> and <metas> at the browser header  (Read 9077 times)

0 Members and 1 Guest are viewing this topic.

manyquestions

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 37
How to change <title> and <metas> at the browser header
« on: September 15, 2006, 10:23:02 am »

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
« Last Edit: September 21, 2006, 04:04:11 pm by Sami »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How to change <title> and <metas> at the browser header
« Reply #1 on: September 15, 2006, 06:30:28 pm »

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.
Logged

twist3r

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: How to change <title> and <metas> at the browser header
« Reply #2 on: September 15, 2006, 10:02:13 pm »

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

Nibbler

  • Guest
Re: How to change <title> and <metas> at the browser header
« Reply #3 on: September 15, 2006, 10:14:51 pm »

It's in the pageheader() theme function.
Logged

twist3r

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: How to change <title> and <metas> at the browser header
« Reply #4 on: September 15, 2006, 10:22:26 pm »

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

Nibbler

  • Guest
Re: How to change <title> and <metas> at the browser header
« Reply #5 on: September 15, 2006, 10:25:20 pm »

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.
Logged

manyquestions

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 37
Re: How to change <title> and <metas> at the browser header
« Reply #6 on: September 18, 2006, 04:11:54 pm »

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
Logged

manyquestions

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 37
Re: How to change <title> and <metas> at the browser header
« Reply #7 on: September 21, 2006, 08:00:05 am »

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
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: How to change <title> and <metas> at the browser header
« Reply #8 on: September 21, 2006, 08:09:38 am »

copy this function to themes/your theme/theme.php if you didn't have it
Code: [Select]
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
Logged
‍I don't answer to PM with support question
Please post your issue to related board

manyquestions

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 37
Re: How to change <title> and <metas> at the browser header
« Reply #9 on: September 21, 2006, 08:56:26 am »

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

Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: How to change <title> and <metas> at the browser header
« Reply #10 on: September 21, 2006, 02:13:22 pm »

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

manyquestions

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 37
Re: How to change <title> and <metas> at the browser header
« Reply #11 on: September 21, 2006, 03:49:59 pm »

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
Logged

bobby131313

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
    • Coin Community Family
Re: How to change <title> and <metas> at the browser header
« Reply #12 on: September 22, 2006, 07:02:20 pm »



Quote
Sorry 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



Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How to change <title> and <metas> at the browser header
« Reply #13 on: September 23, 2006, 08:57:01 am »

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

bobby131313

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
    • Coin Community Family
Re: How to change <title> and <metas> at the browser header
« Reply #14 on: September 23, 2006, 09:58:15 am »


Quote
Google 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.

Logged

Aeronautic

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 125
  • Photographer / film maker turned webmeister...
Re: How to change <title> and <metas> at the browser header
« Reply #15 on: December 25, 2006, 11:01:40 pm »

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...

Code: [Select]
        '{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
Code: [Select]
{META} and
Code: [Select]
$meta looking for parameters to try.

Thanks!
Logged

Aeronautic

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 125
  • Photographer / film maker turned webmeister...
Re: How to change <title> and <metas> at the browser header
« Reply #16 on: December 26, 2006, 06:13:37 am »

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.
Logged
Pages: [1]   Go Up
 

Page created in 0.059 seconds with 15 queries.