Adding an image-block to header.php
Permalink
Hey folks!
Im trying to add an image to my header.php.....
What I want to have in the end is my logo, a global header nav and a not-global image-block, that I can change the image on each site.
Can somebody tell me please what I have to add?!
Thanks a lot
Fussel
***
right now it looks like this:
</head>
<body>
<div id="page" class="<?php echo ($liquid)?'liquid':''?>">
<div id="headerSpacer"></div>
<div id="header">
<?php if ($c->isEditMode()) { ?>
<div style="min-height: 80px">
<?php } ?>
<div id="headerNav">
<?php
$a = new GlobalArea('Header Nav');
$a->display($c);
?>
</div>
<div id="logo"><!---->
<a href=""><img src="<?php echo $this->getThemePath()?>/images/header_logo.png" alt="Logo" />
</a><!----></div>
<?php
// we use the "is edit mode" check because, in edit mode, the bottom of the area overlaps the item below it, because
// we're using absolute positioning. So in edit mode we add a bit of space so everything looks nice.
?>
<div class="spacer"></div>
<?php if ($c->isEditMode()) { ?>
</div>
<?php } ?>
<div id="header-area">
<div class="divider"></div>
Im trying to add an image to my header.php.....
What I want to have in the end is my logo, a global header nav and a not-global image-block, that I can change the image on each site.
Can somebody tell me please what I have to add?!
Thanks a lot
Fussel
***
right now it looks like this:
</head>
<body>
<div id="page" class="<?php echo ($liquid)?'liquid':''?>">
<div id="headerSpacer"></div>
<div id="header">
<?php if ($c->isEditMode()) { ?>
<div style="min-height: 80px">
<?php } ?>
<div id="headerNav">
<?php
$a = new GlobalArea('Header Nav');
$a->display($c);
?>
</div>
<div id="logo"><!---->
<a href=""><img src="<?php echo $this->getThemePath()?>/images/header_logo.png" alt="Logo" />
</a><!----></div>
<?php
// we use the "is edit mode" check because, in edit mode, the bottom of the area overlaps the item below it, because
// we're using absolute positioning. So in edit mode we add a bit of space so everything looks nice.
?>
<div class="spacer"></div>
<?php if ($c->isEditMode()) { ?>
</div>
<?php } ?>
<div id="header-area">
<div class="divider"></div>
do you want to have a defined image?
or an image block?
or an image block?
A block - I want to be able to change the image on each site.
Or dont add an image on some pages...
Or dont add an image on some pages...
Then you can just add an area, and on every page add the image block.
Define you styles for #logo-container, and then on each page you just click on 'Add To Logo', choose 'Add Block' and select 'Image'.
You will then need to add the logo from the file manager. If you don't have the logo in the file manager you will have to upload it.
<div id="logo-container"> <?php $a = new Area('logo'); $a->display($c); ?> </div>
Define you styles for #logo-container, and then on each page you just click on 'Add To Logo', choose 'Add Block' and select 'Image'.
You will then need to add the logo from the file manager. If you don't have the logo in the file manager you will have to upload it.
Thanks adajad!
That sounds great!
And how do I define the styles? In a css-file? But which one? And How....?!
Thanks,
Fussel
That sounds great!
And how do I define the styles? In a css-file? But which one? And How....?!
Thanks,
Fussel
If you are using any blocks & you want to reuse it, then its better to create a stack. And add the block on that stack. Then click on the design link & put your custom styles.
Rony
Rony
hey,
sorry, i dont get it...
I added a logo-container, everything fine, but its somewhere in the header... I tried on diferent lines in the header.php but none of them really worked, the logo is either above everything else or at the same place as the "header-nav-edit-button".
How can I put it under the header-nav?
Here is my code:
I added 2 pictures how it looks.
sorry, i dont get it...
I added a logo-container, everything fine, but its somewhere in the header... I tried on diferent lines in the header.php but none of them really worked, the logo is either above everything else or at the same place as the "header-nav-edit-button".
How can I put it under the header-nav?
Here is my code:
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd"> <html lang="en"> <head> <!-- Site Header Content //--> <link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('minimalist_base.css')?>" /> <link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('minimalist_styles.css')?>" /> <link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('typography.css')?>" /> <?php Loader::element('header_required'); ?> </head> <body> <div id="page" class="<?php echo ($liquid)?'liquid':''?>"> <div id="headerSpacer"></div> <div id="header">
Viewing 15 lines of 50 lines. View entire code block.
I added 2 pictures how it looks.
but am I on the right way? :)
or do I have to change something somewhere else?
***
<div id="image-block">
<?php
$a = new Area('image-block');
$a->display($c);
?>
</div>