benbyf Posted May 25, 2016 Share Posted May 25, 2016 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/ Link to comment Share on other sites More sharing options...
ottogal Posted May 25, 2016 Share Posted May 25, 2016 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... 1 Link to comment Share on other sites More sharing options...
benbyf Posted May 25, 2016 Author Share Posted May 25, 2016 indeed. but like I said my code hasn't changed and is contained in the _main.php so should be the same for all... :/ Link to comment Share on other sites More sharing options...
ottogal Posted May 25, 2016 Share Posted May 25, 2016 Perhaps the "Files" settings of your templates are different? Without knowing the templates and their settings it's not easy to help... 1 Link to comment Share on other sites More sharing options...
benbyf Posted May 26, 2016 Author Share Posted May 26, 2016 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. Link to comment Share on other sites More sharing options...
ottogal Posted May 26, 2016 Share Posted May 26, 2016 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...) 1 Link to comment Share on other sites More sharing options...
cstevensjr Posted May 26, 2016 Share Posted May 26, 2016 Here is what I see in Chrome and Firefox. As @ottogal says, it shows the error on the home page. Chrome (Main Page) Chrome (Any page other than Home) Firefox (Main Page - Note the Security Warning) Firefox (Main Page) 1 Link to comment Share on other sites More sharing options...
Soma Posted May 26, 2016 Share Posted May 26, 2016 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? 3 Link to comment Share on other sites More sharing options...
benbyf Posted May 27, 2016 Author Share Posted May 27, 2016 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 Link to comment Share on other sites More sharing options...
Soma Posted May 27, 2016 Share Posted May 27, 2016 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. 2 Link to comment Share on other sites More sharing options...
benbyf Posted May 27, 2016 Author Share Posted May 27, 2016 where can this be changed in the template settings? I couldn't see anything that refers to output formating. Link to comment Share on other sites More sharing options...
Martijn Geerts Posted May 27, 2016 Share Posted May 27, 2016 Maybe you have an autoload module or an init file somewhere that puts the output formatting off. 5 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now