Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#14 | 2011-11-22 ver746 jo det lykdes sorme - med den der stringændring jeg addede.JPG | 219.22 KB | AneDue1 |
Comments
Comment #1
bwill CreditAttribution: bwill commentedI 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!
Comment #2
laservert CreditAttribution: laservert commentedThe 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.
Comment #3
Talacrush CreditAttribution: Talacrush commentedThe 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.
Comment #4
OSEguy CreditAttribution: OSEguy commentedAlso 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.
Comment #5
bwill CreditAttribution: bwill commentedThanks OSEguy ...
That worked for me as well.
Comment #6
CptCotton CreditAttribution: CptCotton commentedFor me #4 worked in combination with #3 (leading /).
Thanks OSEguy and Talacrush! :-)
Comment #7
ligulas CreditAttribution: ligulas commentedAlso 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
Comment #8
bwill CreditAttribution: bwill commentedmayo/templates
Comment #9
sunketh CreditAttribution: sunketh commentedHad 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:
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.
Comment #10
Danilo_Yali CreditAttribution: Danilo_Yali commentedHi 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.
Comment #11
mermentau CreditAttribution: mermentau commented@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
Comment #12
AneDue1 CreditAttribution: AneDue1 commentedThankyou Sunketh,
This did it.
Renaming my imagefile to pat-0.png.
I also added the string-correction in page.tpl.php.
Regards,
Comment #13
mermentau CreditAttribution: mermentau commentedThis is issue should be fixed in the latest version released which is 7.x-1.2.
Comment #14
AneDue1 CreditAttribution: AneDue1 commentedHi 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...
.
Comment #15
mermentau CreditAttribution: mermentau commented@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.
Comment #16
AneDue1 CreditAttribution: AneDue1 commentedThanks for good advice.
I'll try that.
;-D
Regards Ane Due
Comment #17
mdrennies CreditAttribution: mdrennies commentedHi 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
Comment #18
mermentau CreditAttribution: mermentau commentedI'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.
Comment #19
mdrennies CreditAttribution: mdrennies commentedMaybe 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
Comment #20
mdrennies CreditAttribution: mdrennies commentedHmm... 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?
Comment #21
mermentau CreditAttribution: mermentau commented@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.
Comment #22
MiraKimura CreditAttribution: MiraKimura commentedLatest 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!
Comment #23
MiraKimura CreditAttribution: MiraKimura commentedToday, have implemented #9, but nothing changes. The custom header image still appear on main page only. Plus, the sitemap page (module site map). Anyone?
Comment #24
MiraKimura CreditAttribution: MiraKimura commentedFound 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!
Comment #25
mermentau CreditAttribution: mermentau commentedComment #26
RGARCIA1974 CreditAttribution: RGARCIA1974 commentedTo 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:
to
Comment #27
violafritsch1983 CreditAttribution: violafritsch1983 commentedHi 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
Comment #28
phillodonoghue CreditAttribution: phillodonoghue as a volunteer commentedHi,
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