forum.coppermine-gallery.net

Support => Older/other versions => cpg1.3.x Support => Topic started by: malooga on September 25, 2005, 07:26:42 am

Title: Title Tag on Home Page
Post by: malooga 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.
Title: Re: Title Tag on Home Page
Post by: malooga on September 27, 2005, 06:16:21 am
I hate talking to myself, but does anyone know how to do this?   :)
Title: Re: Title Tag on Home Page
Post by: Tranz on September 27, 2005, 07:34:14 am
Try template.html. ooh, but it will be the same for all pages.  :-\\
Title: Re: Title Tag on Home Page
Post by: malooga 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.
Title: Re: Title Tag on Home Page
Post by: malooga 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.
Title: Re: Title Tag on Home Page
Post by: artistsinhawaii 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
Title: Re: Title Tag on Home Page
Post by: Stramm 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
Title: Re: Title Tag on Home Page
Post by: artistsinhawaii 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
Title: Re: Title Tag on Home Page
Post by: Stramm 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
Title: Re: Title Tag on Home Page
Post by: Joachim Müller 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
Title: Re: Title Tag on Home Page
Post by: zzz on January 20, 2006, 08:51:11 pm
did this howto ever get made?
Title: Re: Title Tag on Home Page
Post by: Joachim Müller on January 21, 2006, 06:15:51 am
obviously, nobody has done it so far. Why don't you do it?
Title: Re: Title Tag on Home Page
Post by: zzz 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.
Title: Re: Title Tag on Home Page
Post by: Stramm 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
Title: Re: Title Tag on Home Page
Post by: Joachim Müller 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
Title: Re: Title Tag on Home Page
Post by: Stramm 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