forum.coppermine-gallery.net
Support => Older/other versions => cpg1.3.x Support => Topic started 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.
-
I hate talking to myself, but does anyone know how to do this? :)
-
Try template.html. ooh, but it will be the same for all pages. :-\\
-
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.
-
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.
-
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
-
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
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
'{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
-
Phew, that's simpler than my approach.
Let me stick a copy of this into my little 'tool box'... thanks Stramm
Dennis
-
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
-
I've always wanted to write an howto.
That would be great! Please go ahead.
;D Joachim
-
did this howto ever get made?
-
obviously, nobody has done it so far. Why don't you do it?
-
apologies,
i was asking from the point of view of not knowing therefore i wouldnt know where to start on the matter.
-
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
-
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
-
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