Advanced search  

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

Pages: [1]   Go Down

Author Topic: Title Tag on Home Page  (Read 15411 times)

0 Members and 1 Guest are viewing this topic.

malooga

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Title Tag on Home Page
« on: September 25, 2005, 07:26:42 am »

I've managed to customize the title tag on all the pages in my gallery by editing the language file and theme.php. It now shows the title of the picture followed by the album name followed by the gallery name. This works great for picture pages and album index pages. The only thing I can't figure out is how to customize the home page title tag. The problem is if I edit the Home in the language file this also changes the breadcrumb. How can I make a totally custom home page title tag without affecting the breadcrumb or any of the other gallery pages? Thanks in advance.
Logged

malooga

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: Title Tag on Home Page
« Reply #1 on: September 27, 2005, 06:16:21 am »

I hate talking to myself, but does anyone know how to do this?   :)
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Title Tag on Home Page
« Reply #2 on: September 27, 2005, 07:34:14 am »

Try template.html. ooh, but it will be the same for all pages.  :-\\
Logged

malooga

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: Title Tag on Home Page
« Reply #3 on: September 27, 2005, 04:29:42 pm »

Try template.html. ooh, but it will be the same for all pages.  :-\\

Yes, that's the problem. To optimize for search engines, you need a unique title on every page ideally. I have accomplished this, except for the home page which I can't figure out.
Logged

malooga

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: Title Tag on Home Page
« Reply #4 on: September 30, 2005, 04:47:28 am »

I assume from the lack of replies that no one knows how to do this. Can one of the veterans here comment? If it can't be done, I'll move on. Thanks.
Logged

artistsinhawaii

  • VIP
  • Coppermine addict
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 856
    • evj art and photography
Re: Title Tag on Home Page
« Reply #5 on: September 30, 2005, 05:10:47 am »

Malooga,

Don't know if this will work...haven't tried it myself, but I think the approach is going to be in your init.inc.php file in the include folder.

1) Make a copy of your theme folder and rename it theme_name2
2) Make the necessary change in this theme's template.html file.

3) Open include/init.inc.php look for the following:


if (!file_exists("themes/{$CONFIG['theme']}/theme.php")) $CONFIG['theme'] = 'classic';
require "themes/{$CONFIG['theme']}/theme.php";
$THEME_DIR = "themes/{$CONFIG['theme']}/";


4) Next, add an 'IF' and '} else {' statement to this before this code[/b.



if ($_GET["album"] == '' ) {
     $theme='yourtheme_shop_1';
       require "themes/yourtheme_shop_1/theme.php";
       $THEME_DIR = "themes/yourtheme_shop_1/";
}  else {

if (!file_exists("themes/{$CONFIG['theme']}/theme.php")) $CONFIG['theme'] = 'classic';
require "themes/{$CONFIG['theme']}/theme.php";
$THEME_DIR = "themes/{$CONFIG['theme']}/";
}


NOTE:  $_GET["album"] == ''   <--true if there is no album number or name (1, -1, 0, lastup, random) so this should cause init.inc.php to display your theme_name2.  Otherwise it should display the theme of your choice for all other options.


Dennis
« Last Edit: September 30, 2005, 05:19:16 am by madeinhawaii »
Logged
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Title Tag on Home Page
« Reply #6 on: September 30, 2005, 09:40:31 am »

Ok, in template.html next to {TITLE} add eg. {ENHANCE}

theme php -> function pageheader($section, $meta = '')
make HTTP_GET_VARS a global
below the global definition
Code: [Select]
if (!isset($HTTP_GET_VARS['cat']))$add = "Text that only appeares on the index when cat is not selected... you can enhance the if with eg $HTTP_GET_VARS['cat'] ==0 || !isset($HTTP_GET_VARS['cat'])";

in $template_vars a few lines below add
Code: [Select]
'{ENHANCE}'=> $add,

this will display $add only in the title of index.php when cat isn't set... the alternative will define $add too when cat=0... means only in the front page and not when viewing a category

artistsinhawaii

  • VIP
  • Coppermine addict
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 856
    • evj art and photography
Re: Title Tag on Home Page
« Reply #7 on: September 30, 2005, 10:47:32 am »

Phew, that's simpler than my approach.

Let me stick a copy of this into my little 'tool box'... thanks Stramm

Dennis
Logged
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Title Tag on Home Page
« Reply #8 on: September 30, 2005, 12:07:48 pm »

the standard way to add dynamic content if anycontent won't do the trick

I've always wanted to write an howto. Example would be a username/ password box  on top of the page seen only be anon users. If logged in it gets replaced by a 'Welcome back usernaeme' and if a PM mod is installed... Private Messages: x unread, total xx

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Title Tag on Home Page
« Reply #9 on: September 30, 2005, 07:22:58 pm »

I've always wanted to write an howto.
That would be great! Please go ahead.

 ;D Joachim
Logged

zzz

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: Title Tag on Home Page
« Reply #10 on: January 20, 2006, 08:51:11 pm »

did this howto ever get made?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Title Tag on Home Page
« Reply #11 on: January 21, 2006, 06:15:51 am »

obviously, nobody has done it so far. Why don't you do it?
Logged

zzz

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: Title Tag on Home Page
« Reply #12 on: January 23, 2006, 04:01:01 am »

apologies,

i was asking from the point of view of not knowing therefore i wouldnt know where to start on the matter.
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Title Tag on Home Page
« Reply #13 on: January 26, 2006, 02:33:46 pm »

you could download my modpack... if you know how to read code you can easily find out where to start

hint: in 1.4x it's themes.inc.php

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Title Tag on Home Page
« Reply #14 on: January 26, 2006, 06:47:14 pm »

themes.inc.php should never be modified, under no circumstances. This should be done instead in the custom theme (theme.php), with code sections copied over from themes/sample/theme.php or themes.inc.php
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Title Tag on Home Page
« Reply #15 on: January 26, 2006, 07:30:28 pm »

you're right... what I meant is that zzz can have a look at the changes I mdae in my modpack's themes.inc.php. With that info it's easy to add functions to theme.php
Pages: [1]   Go Up
 

Page created in 0.032 seconds with 20 queries.