Site Title Logo

Hi,

Happy New Year! So I have my site up and running - hurray.

I have customised the feel of the Santa Fe theme and inserted my own header logo according to the following instruction:

You can pass any text you want, including the HTML to display your image, as a parameter to link_to_home_page().

<?php echo link_to_home_page('<img src="myimage.png" />'); ?>

which was offered in a previous post. This all seemed to be quite a smooth process. The title logo is still there when you click on the links to Browse Collections/Browse Items etc BUT when you go to the second or subsequent pages the title logo disappears. Any suggestions as to what needs to be altered. I suspect it might be something in the <?php head> tag for Browse Collections/Browse Items which includes an array. But my php skills are limited at best.

Any help would be very welcome,

Alex

The problem you're having is that the src attribute of your image tag uses a relative link.

Instead, you should use Omeka's img() helper to include the logo.

Essentially, you want to put your logo in the "images" directory of the current public theme. Then, replace the img tag in your link_to_home_page function with:

<img src="<?php echo img('myimage.png'); ?>" />

Hi John,

How does one deal with the triple nested quotes in that line of code? I keep getting T-string errors... (using php5) What am I doing wrong here?

<div id="site-title"><?php echo link_to_home_page('<img src="<?php echo img('logo.png'); ?>" />'); ?></div>

Also, my image is located in the my theme's images/directory and looks fine when I call it using the img()helper outside of the link_to_home_page_ function, but for some reason it cannot find the image once inside that, unless I use the full URL. What path am I supposed to use to get to the images folder within that function?

I'm sure there is something basic I'm missing here but as I'm just staring this Omeka journey I could use a nudge in the right direction!

Thanks

Once you open up a block of PHP, you don't need to open it up again. To make things a little easier to read and follow, you could write it out like this:

<?php
$logo_image_tag = "<img src='" . img('logo.png') . '" />";
?>

<div id="site-title"><?php echo link_to_home_page($logo_image_tag); ?></div>

Oh, I see - that makes more sense. Thanks!