Hi,

When I install mayo theme and go to Screen settings, in "Layout Settings" section the images are not showing. Looking in the code, the problem is in relative path. The code is in this absolute path:

http://127.0.0.1/sites/all/themes/mayo/images/page-layout.png

but the correct (in my case) would be:

http://127.0.0.1/mysite/sites/all/themes/mayo/images/page-layout.png

We would like to know what file, and what line, we can change this.

Thank you

CommentFileSizeAuthor
print.png35.75 KBwescleyteixeira
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mermentau’s picture

Category: Bug report » Support request

I think you should look into how the site itself is configured in your hosting environment. Looks like you are in localhost on your PC. I have it that way also. It's an xampp set up on Windows 7. Try looking in your apache httpd-vhosts.conf file and see if you have it set up properly.

The MAYO code is good and works as is for localhost and hosted VPS.

riedel.andre@gmail.com’s picture

I am using your theme at a share hoster. To administrate the site I use the https-proxy of the hoster.

normal address: www.website.com
via proxy: ssl-proxy.com/www.website.com

I can confirm the behaviour, wescleyteixeira mentioned.

For Example in the file "templates/page.tpl.php" at line 109-111 the dash should be deleted.

before:

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

after:

<?php
  if($header_watermark) {
    $header_watermark_style = 'background-image: url(' . drupal_get_path('theme', 'mayo') . '/images/pat-' . $header_watermark . '.png);';
  }
?>
joachim’s picture

Version: 7.x-2.1 » 7.x-2.x-dev
Category: Support request » Bug report
Priority: Minor » Major
    '#prefix' => '<img src="/' . drupal_get_path('theme', 'mayo') . '/images/base-layout.png" /><br />',

There should not be an initial / here! url() should always be used to generate URLs!

Upping to major -- the admin UI is broken on sites in subfolders.

  • mermentau committed 40faeb8 on 7.x-2.x
    Used url() for Admin UI images as suggested by #3 in #2324885.
    
mermentau’s picture

Status: Active » Needs review

Just committed fix suggested by joachim in #3 for all admin UI images. Thanks for your help.

mermentau’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

maxlife58’s picture

Not fixed for me, i update from 1.3 to 2.4, all works well only the image path on admin screen doesn't work! The problem is with a multilanguage site because mayo search the image in en/sites/all..... insetad of sites/all....

How can i fix???

Thanks

GStegemann’s picture

Status: Closed (fixed) » Needs work

The same here.

The following is found in the webserver log:

192.168.1.32 - - [17/Mar/2015:16:30:40 +0100] "GET /cm7/de/admin/appearance HTTP/1.1" 200 257092 "http://www.example.com/cm7/de/admin/modules" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0"
192.168.1.32 - - [17/Mar/2015:16:31:28 +0100] "GET /cm7/de/sites/all/themes/mayo/images HTTP/1.1" 404 52192 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0"
192.168.1.32 - - [17/Mar/2015:16:31:29 +0100] "GET /cm7/de/js/admin_menu/cache/f6f9068632413cd5273324729ac6d669 HTTP/1.1" 200 15362 "http://www.example.com/cm7/de/sites/all/themes/mayo/images" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0"
192.168.1.32 - - [17/Mar/2015:16:31:41 +0100] "GET /cm7/de/sites/all/themes/mayo/images/water-mark.png HTTP/1.1" 404 53082 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0"
192.168.1.32 - - [17/Mar/2015:16:31:56 +0100] "GET /cm7/sites/all/themes/mayo/images/water-mark.png HTTP/1.1" 404 53076 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0"

On multilanguage sites the path to the images should not include the language code.

GStegemann’s picture

mermentau’s picture

I have no experience with multilanguage sites so any ideas how I could duplicate the issue?

maxlife58’s picture

Hi Mermentau, to reproduce this error you can activates the module Locale that is part of Drupal core, then download and activates the Internationalization module, now add a new language from configuration / Languages / Add Language.

Now the first page of your site will be xxx.com/en or xxx.com/it (if for example the second language is Italian). Then you can visit MAYO setting to see if the error is replicated.

GStegemann’s picture

How about using file_create_url?

'#prefix' => '<img src="' . file_create_url(drupal_get_path('theme', 'mayo') . '/images/base-layout.png') . '" /><br />',

Tested and looks working.

maxlife58’s picture

Thank you GStegemann, change "url" with "file_create_url" in MAYO theme-settings.php works fine for me.

Thanks

maxlife58’s picture

I suggest to change with file_create_url the Header watermark line in page.tpl.php in templates folder, without this change the watermark header selected in MAYO settings are not displayed.

mermentau’s picture

@maxlife58, Are you sure there is not something else in addition to your #12 above. Quick try and it's not working. I would like to test the solution myself.

Never mind I have it working now.

mermentau’s picture

Status: Needs work » Needs review

Changed to file_create_url() in 6 lines in theme-settings.php and one line in page.tpl.php as suggested #13 and #15. Committed the changes to the dev version so testing would be appreciated. Modified my test site to be multilingual and tested there with good result.

Thanks for reporting and the help.

GStegemann’s picture

You're welcome. And many thanks for your fixes.

I already made the changes today on my site. I can test the dev version most probably tomorrow.

GStegemann’s picture

Tested and works for me.

maxlife58’s picture

Tested and works for me too.

Thanks

mermentau’s picture

Status: Needs review » Fixed

Fix added to 7.x-2.5 release.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.