If in theme-settings.php I replace
... img src=/". drupal_get_path('theme', 'mayo') ...
by
... img src="'. drupal_get_path('theme', 'mayo') ...
and in page.tpl.php
'background-image: url(/'
by
'background-image: url(' , I solve the second problem, but I can't display the header background image.

Anyone have a solution?

Thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bwill’s picture

I have the same issue - I can't get a header background image to display. Running on Drupal 7, local host. I tried changing the path to http://localhost/sitename/sites/image_path and it shows in the skin preview with the default MAYO logo and tag line - even though I have those turned off. But it does not display while viewing the site. I had to put a block in the header region with my image linked - this works, but I would like the skin to behave as designed. Thanks!

laservert’s picture

The behaviour is different with the browser:

I9/Drupal 7.0: I get a colored header, header watermark but no header background image.
Firefox/Drupal 7.0: I get no colored header with header watermark and header background image.

Talacrush’s picture

The solution is to get rid of the leading forward slash (/) on the url of the background image - but I cant figure out how :\

Firebug in Firefox reveals the following:

height: 90px; background: url("/sites/default/files/bg-image filename.jpg") repeat scroll left top transparent; border: medium none;

so it should be:

height: 90px; background: url("sites/default/files/bg-image filename.jpg") repeat scroll left top transparent; border: medium none;

but I simply can't find anywhere to prevent the slash being inserted. However, in the file "page.tpl.php" at line 100, there is this code:

$header_style .= 'background: url(' . $header_bg_file . ') repeat ';

and I think this may need changing somehow, but I've no idea other than this vague notion .. sorry I can't be anymore helpful but maybe this will give someone a clue as to where to look.

OSEguy’s picture

Also encountered this problem.
It seems to be caused by the gradient filter style.
I solved the problem by changing the line in page.tpl.php from:
$header_style .= 'background: url(' . $header_bg_file . ') repeat ';
to:
$header_style .= 'filter:;background: url(' . $header_bg_file . ') repeat ';
This overides the filter setting to null.
Hope this helps.

bwill’s picture

Thanks OSEguy ...

That worked for me as well.

CptCotton’s picture

For me #4 worked in combination with #3 (leading /).
Thanks OSEguy and Talacrush! :-)

ligulas’s picture

Also encountered this problem.
It seems to be caused by the gradient filter style.
I solved the problem by changing the line in page.tpl.php from:
$header_style .= 'background: url(' . $header_bg_file . ') repeat ';
to:
$header_style .= 'filter:;background: url(' . $header_bg_file . ') repeat ';
This overides the filter setting to null.

Where do i find the "page.tpl.php" can anyone give me the exact location. I don't find it.
Have the same problem

Ligulas

bwill’s picture

mayo/templates

sunketh’s picture

Had trouble with background image not coming. Instead the background was white washed when image & watermark both were enabled. Found two problems:

1. The $header_bg_file variable had a leading '/', due to which image was not getting located. So added a line in page.tpl.php to remove that:

$header_bg_file = str_replace("/sites","sites",$header_bg_file);

2. When you don't want any watermark image, the watermark line would point to 'pat-0.png' file which is not there. Can't that be put in a if statement? Just food for thought.

Danilo_Yali’s picture

Hi Guys,
I got over the issue of header image display by merely going to the image folder of Mayo and uploaded the image I want to use and named this image the same as one of the images that is recognized by Mayo. However I first renamed the image which was already in the image folder. I find this is the simplest way to get around this issue. In fact you could do this with the several images in the images directory.

mermentau’s picture

Status: Active » Postponed (maintainer needs more info)

@laservert, In regard to the original issue I can't duplicate the path problems with the extra "/". There are several places theme-settings.php that use almost the same code as you indicate, but it appears that you have a typo and without a line number it's not certain where in the code you refer. A patch would eliminate errors in communicating where in the code you mean.

@OSEguy, The fix you suggest in #4 is in the commit for today. More can be seen on this here: http://drupal.org/node/1218018

AneDue1’s picture

Thankyou Sunketh,

This did it.
Renaming my imagefile to pat-0.png.
I also added the string-correction in page.tpl.php.

Regards,

mermentau’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

This is issue should be fixed in the latest version released which is 7.x-1.2.

AneDue1’s picture

Hi Bumpaw,

I'm sure you're right.
Actually my succes with a repeating background-image was only temporary.
In the last couple of hours - again - I haven't been able to put the repeating header image on my Mayo-themed Drupal-site.
So maybe it was luck, that it worked for a while.

I'm new to drupal, a beginner.
So, if you have the time, please enlighten me:
Isn't Drupal 7.0 the latest version?

I use Drupal 7.0.
And it doesn't work very well.

regards,
;-D
Ane Due

----
Added 10 min later:
I think it must be an error in the MAYO-theme.
When I use Bartik, it works.
--------

I have attached a picture of my site, from when it looked it's best...
.

mermentau’s picture

@AneDue1, The latest version of Drupal is 7.9 and there have been a couple of security fixes since 7.0. The latest version of MAYO is 7.x-1.2. Please use both of these and then if you are still having trouble open a fresh issue as this one is closed. Please try and give as many details when you do so that the problem can be duplicated for solution.

AneDue1’s picture

Thanks for good advice.
I'll try that.
;-D

Regards Ane Due

mdrennies’s picture

Version: 7.x-1.1 » 7.x-1.2
Status: Closed (fixed) » Needs review

Hi there,

Just downloaded most recent version of Mayo today after updating my drupal install to 7.12 (local, running on MAMP- just getting my training wheels here).

I am having the same issue described above- can't display an image in the header background- just comes up blank, and overrides the logo and site title name. Hesitant to go in and start changing code in the .php files as it sounds like this was resolved? Viewing the site in Safari.

Also, can't get the watermark to appear. Related? Thoughts?

Mike

mermentau’s picture

I'm suggesting that it's an install issue on your end. Can you try a test install on a subdomain like dev.example.com where you will have it in the actual environment as when it's going to be a live site. I have multiple dev sites in WAMP and LAMP localhost situations plus on my VPS. I also have a shared hosting test and they all work fine. With over 4000 mayo users there would be more activity here if this was a true Mayo bug.

mdrennies’s picture

Maybe a newbie problem- turned out after doing my drupal upgrade I had some pending database updates that I hadn't seen in my configuration section; ran the updates, and as long as I remove the preceding forward slash from the picture location (see #3, #9 above), voila, my header displays a picture.

Still can't get the watermark to work, but perhaps that's a different thread...

Thanks,

Mike

mdrennies’s picture

Hmm... an interesting follow-up issue- the header image only displays in basic page content, not articles... if I remove the image, the colour banner appears for both page types. Is this something where there is a separate .php file for articles that requires this forward-slash work around?

mermentau’s picture

Status: Needs review » Closed (fixed)

@mdrennies, You had no comment on my suggestion so I'm really unable to help. I still contend that most of what I hear is install issues on varius WAMP, MAMP, or XAMPP servers.

MiraKimura’s picture

Latest Drupal 7 and Mayo.

Uploaded picture header, but doesn't appear.

Removed the first "/" at (Advanced header settings > URL of the header background image), and it appears!!

But only for the main page, not others.

Haven't tried the suggested solution above though. As I thought they have been patched in Mayo's latest version.

Please help! TQ!

MiraKimura’s picture

Status: Closed (fixed) » Needs review

Today, have implemented #9, but nothing changes. The custom header image still appear on main page only. Plus, the sitemap page (module site map). Anyone?

MiraKimura’s picture

Found the solution. Thanks to http://kripkornstudios.com.my.

It's actually occurred for the installation files is in a sub-directory (v1, v2 etc.).

I've changed the code in page.tpl.php:

$header_style .= 'filter:;background: url(' . $header_bg_file . ') repeat ';

to

$header_style .= 'filter:;background: url(' . $base_path . '/' . $header_bg_file . ') repeat ';

Maybe the developer should find a way to cater this?

Thanks!

mermentau’s picture

Status: Needs review » Closed (fixed)
RGARCIA1974’s picture

To fix the issue related to watermark not displaying on header background image, do the following change on your page.tpl.php file under ../themes/mayo:

if($header_watermark) {
$header_watermark_style = 'background-image: url(/' . drupal_get_path('theme', 'mayo') . '/images/pat-' . $header_watermark . '.png);';

to

if($header_watermark) {
$header_watermark_style = 'background-image: url(' . drupal_get_path('theme', 'mayo') . '/images/pat-' . $header_watermark . '.png);';

violafritsch1983’s picture

Hi there,
I had the same problem with the header img.
I changed ths skript to
$header_style .= 'filter:;background: url(' . $base_path . '/' . $header_bg_file . ') repeat ';

The image is shown now, but much tooooo big ;(
What can I do that it will be resized?

Thanx

phillodonoghue’s picture

Hi,
A simple workaround that has worked for me is to replace one of the existing header images with your own file. Note that the exiting files are .png so I tested this with a png file.

The default "star" background is in /themes/mayo/images/pat-5.png. Backup this file by renaming it say to pat-5b.png and rename an image file that you want to display to pat-5.png.

In the settings select "star" from the list and your image will display in the header.

Regards
Phill