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>

Fussel
View Replies:
Fussel replied on at Permalink Reply
Fussel
hm. I tried this, but it changes nothing...

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>
Paradiesgarten replied on at Permalink Reply
do you want to have a defined image?
or an image block?
Fussel replied on at Permalink Reply
Fussel
A block - I want to be able to change the image on each site.
Or dont add an image on some pages...
adajad replied on at Permalink Reply
adajad
Then you can just add an area, and on every page add the image block.

<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.
Fussel replied on at Permalink Reply
Fussel
Thanks adajad!
That sounds great!
And how do I define the styles? In a css-file? But which one? And How....?!
Thanks,
Fussel
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
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
Fussel replied on at Permalink Reply 2 Attachments
Fussel
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:

<?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">

I added 2 pictures how it looks.