Members: 16,996
Threads: 38,845
Posts: 159,389
Online: 21

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etracker® Web-Controlling statt Logfile-Analyse

Go Back   Mambers.com > Development > Module Development

Reply
 
LinkBack Thread Tools Display Modes
Old 25.04.2004, 05:21   #1 (permalink)
Junior Mamber
 
darkchild's Avatar
 
Join Date: Apr 2004
Location: Toronto
Posts: 25
darkchild is on a distinguished road
Default Changing Header Image Module

There was a discussion a while back regarding a dynamic header and Mr Jinx provided some code for this. I have implemented the dynamic on one of my sites. Here is a snippet of Mr Jinx's css code:
Code:
#header {
	width: 800px; height: 138px;
	background: url(../images/stories/header.gif) no-repeat;
	}
body#News  #header { background-image: url(../images/stories/header1.gif)    }
body#Music  #header { background-image: url(../images/stories/header2.gif)    }
Essentially, the item after "body#" is the menu item. Does anyone have any idea how i can add a sublevel menu item to this sequence?
__________________
darkchild is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 25.04.2004, 10:42   #2 (permalink)
Professional Mamber
 
eyezberg's Avatar
 
Join Date: Apr 2004
Location: Gap / France
Posts: 860
eyezberg is an unknown quantity at this point
Default Re: Changing Header Image Module

In exactly the same way.
You can name them however you want,
the important thing is just how you set the style to be used,
so when checking the page you're on, the CSS style you select accordingly
can be anything you want, as in body#sub or body#newssub or whatever..
How did you write the switch code?
__________________
joe / ex Mambo ex Doc Team
Eyezberg.com
eyezberg is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 25.04.2004, 15:58   #3 (permalink)
Junior Mamber
 
darkchild's Avatar
 
Join Date: Apr 2004
Location: Toronto
Posts: 25
darkchild is on a distinguished road
Default Re: Changing Header Image Module

Quote:
Originally Posted by eyezberg
In exactly the same way.
You can name them however you want,
the important thing is just how you set the style to be used,
so when checking the page you're on, the CSS style you select accordingly
can be anything you want, as in body#sub or body#newssub or whatever..
How did you write the switch code?

I didnt write the code. Mr Jinx wrote it. I added the following to my template index.php file (after the head tag and replacing the body tag):
Code:
<?php include_once ("templates/hosting/template.php"); ?>
<body id="<?php echo getMenuName(); ?>">
I also created the template.php file which resides in the template folder.

Code:
?php
// $Id: template.php,v 1.0 2004/02/05 00:00:00 jjanssens Exp $
/**
* Editor handler
* @package Mambo Open Source
* @Copyright (C) 2000 - 2003 Miro International Pty Ltd
* @ All rights reserved
* @ Mambo Open Source is Free Software
* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
* @version $Revision: 1.4 $
**/

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

function getMenuName()
{
   global $Itemid;
   $name = getMenu($Itemid);
   
   $name = ereg_replace('[/ ]', "", strtolower($name));
   return $name;
}

function getMenu($itemid)
{
   global $database;   

   $sql = "SELECT name FROM #__menu WHERE id='$itemid'";
   $database->setQuery( $sql );
   
   return $database->loadResult();
}


?>
and the css code is as follows:
Code:
#header {
	width: 800px; height: 138px;
	background: url(../images/stories/header.gif) no-repeat;
	}
body#MyNews  #header { background-image: url(../images/stories/header1.gif)    }
body#MyDezigns  #header { background-image: url(../images/stories/header2.gif)    }
body#MyFamily  #header { background-image: url(../images/stories/header3.gif)    }
   }
Now I tried what (I thought )u suggested. I have a sub menu item under My Family called
"Last Vacations" so i added the following:
Code:
body#MyFamily/LastVacations  #header { background-image: url(../images/stories/header1.gif)    }
....and it didn't work. I also tried just entering the submenuitem after "body#" without success. I would appreciate your help.
__________________
darkchild is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 17.07.2004, 08:04   #4 (permalink)
Baby Mamber
 
Join Date: Jul 2004
Posts: 2
ktizo is on a distinguished road
Send a message via ICQ to ktizo
Default Re: Changing Header Image Module

hi, I'm having problems with changing the header for Search. The body id registers something like this <body id="">. Can anyone help in how to insert a var in the mod_search so that the body id can register <body id="search">.
Any help would be much appreciated.
ktizo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 17.07.2004, 11:39   #5 (permalink)
YTW
Junior Mamber
 
YTW's Avatar
 
Join Date: Apr 2004
Location: Madrid, Spain
Posts: 29
YTW is on a distinguished road
Default Re: Changing Header Image Module

I am not quite sure if this thread is still alive but, regarding the header switcher code of Mr Jinx:

in your css when calling the page:

1. do not use caps letter nor space
2. the script is based on a link name not the menu hierarchy. body#lastvacations

For the search issue, not quite sure to understand waht you mean. Any url to see the problem ?¿
__________________
Visit 55 Thinking and YTW

Good looking, fast & practical web sites
YTW is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 21.07.2004, 01:38   #6 (permalink)
Senior Mamber
 
Join Date: May 2004
Posts: 163
kergo is on a distinguished road
Default Re: Changing Header Image Module

I understand how the script is workin, but it's containing the whole <body> although it would be adequate to put the
Code:
id="<?php echo getMenuName(); ?>"
in the DIV-Tag where the header-image is (as a background-image). Or am I gettin high?
kergo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 21.07.2004, 11:09   #7 (permalink)
YTW
Junior Mamber
 
YTW's Avatar
 
Join Date: Apr 2004
Location: Madrid, Spain
Posts: 29
YTW is on a distinguished road
Default Re: Changing Header Image Module

That's 100% correct you need that id in the body tag:

<?php include_once ("yourpathtothescript/headerswitcher.php"); ?>
<body id="<?php echo getMenuName(); ?>">
__________________
Visit 55 Thinking and YTW

Good looking, fast & practical web sites
YTW is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 21.07.2004, 15:02   #8 (permalink)
Baby Mamber
 
Join Date: Jul 2004
Posts: 2
ktizo is on a distinguished road
Send a message via ICQ to ktizo
Default Re: Changing Header Image Module

Thanks all for your kind reply, I managed to get the customised header in all the different section except for Search component as theres no Itemid.
All others work because it has the Itemid=blahblah.
ktizo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 21.07.2004, 16:38   #9 (permalink)
Senior Mamber
 
Join Date: May 2004
Posts: 163
kergo is on a distinguished road
Default Re: Changing Header Image Module

Hmm, with this headerswitch you can switch the whole design for every section/category ...
kergo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03.03.2005, 04:07   #10 (permalink)
Expert Mamber
 
kachete's Avatar
 
Join Date: Apr 2004
Location: Venezuela
Posts: 345
kachete is on a distinguished road
Send a message via ICQ to kachete Send a message via MSN to kachete Send a message via Yahoo to kachete
Default Re: Changing Header Image Module

i want to implement it in my pages

can you gave us a solution in a newbie language so we can put it to work

you speak as you only talk php or mambo here

please help us here with a simple way or a tutor for it PLEASE

thanks in advance
__________________
No hay preguntas tontas, Solo Tontos que no preguntan
www.kachetewebsites.com / www.misitiove.com
kachete is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Template -> different Header Image on specific pages Quizzer Mambo 4.5 'How Do I' Questions 8 22.06.2005 21:12
[Q] "Best" Image Gallery Component / Module? TheEdge Mambo 4.5 General Talk 7 26.08.2004 18:11
How to add an Image next to the Module Title evilfx Module 'How Do I' Questions 4 29.06.2004 00:49
How do I implement a random header image for my template formad Template Discussions 1 13.04.2004 10:05
How to change the header image in a template? ralfmarkus Mambo 4.5 'How Do I' Questions 2 09.04.2004 23:09


All times are GMT +2. The time now is 08:13.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.