Jump to content

Recommended Posts

Posted

strange thing keeps happening to me when accessing an image on the homepage.

The logo for this site appears on all pages in chrome and safari except for the homepage even though the code doesnt change:

$logo = $homepage->site_logo;
echo $logo->url;

http://betaville.nicegrp.com/

Posted

On your homepage you have

style="background-image:url(/site/assets/files/1/)"

instead of

style="background-image:url(/site/assets/files/1/logo.svg)"

which seems to explain the issue... ;)

  • Like 1
Posted

indeed. but like I said my code hasn't changed and is contained in the _main.php so should be the same for all... :/

Posted

Perhaps the "Files" settings of your templates are different?

Without knowing the templates and their settings it's not easy to help...

  • Like 1
Posted

Thanks, not sure theres anything going on much in the templates. The file is being uploaded into the "file" field on the homepage. It seems to work fine on Firefox but anything else I can the url without file name and extension.

Posted

Strange: I'm in Firefox. The Web Developer Tool says the image could not be loaded - likewise in both cases,

be it /site/assets/files/1/ or /site/assets/files/1/logo.svg ! (Even if in the second case it is shown on the page...)

  • Like 1
Posted

Here is what I see in Chrome and Firefox.  As @ottogal says, it shows the error on the home page.

Chrome (Main Page)

post-756-0-33552800-1464274597_thumb.png

Chrome (Any page other than Home)

post-756-0-37132700-1464274659_thumb.png

Firefox (Main Page - Note the Security Warning)

post-756-0-65043400-1464274671_thumb.png

Firefox (Main Page)

post-756-0-28495200-1464274684_thumb.png

  • Like 1
Posted

If your image site_logo is set to multiple files, your code will output the url to the assets folder of the page

"/site/assets/files/1/"

If your image site_logo ist set to allow only 1 file, your code will output

"/site/assets/files/1/logo.svg"

If the outputformatting for the page is off, both cases will output

"/site/assets/files/1/"

So my guess is that on your homepage, somehow output formatting is turned off?

  • Like 3
Posted

this seemed to fixed it, as the field was already set to single item.

$page->of(true);
$logo = $homepage->site_logo;
$page->of(false);

any reason for this, not really needed to use outputformating() before

Posted

The reason you would have to look for is why the homepage has output formatting turned off, because it's not usual at all. Output formatting is always turned on in front-end templates. 

  • Like 2
Posted

where can this be changed in the template settings? I couldn't see anything that refers to output formating.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...