Jump to content

Recommended Posts

Posted

Hi -

All images served from PW's image fields are giving me 403s. Any ideas why?

For context, inspect on the slider here: http://archnetglobal.com/

Thanks.

EDIT: Relevant line of code below.

<img src="<?php echo $slide->image->url; ?>" />

(Missing ALT tag right now)

Posted

Welcome to the forums Svitcov!

Looks like you are trying to directly access the assets folder using a PHP file that is not a template file? If that is the case, PW will block you from directly accessing that and other folders, e.g. /site/templates/ using your own PHP files.

Posted

Hi,

your src of the images i sonly the path to the folder, the files-basename is missing!

<img src="/site/assets/files/1011/" />

What do you use in the code of your template-file?

Posted

@Kongondo - Actually, the PHP file is a template file. It is my home page template.

@horst - See OP, I edited a few mins ago.

Posted (edited)

Welcome to the forums Svitcov!

Looks like you are trying to directly access the assets folder using a PHP file that is not a template file? PW will block you from directly accessing that and other folders, e.g. /site/templates/ using your own PHP files.

@kongondo: I think this is not right. The images reside in the site/assets/files/ folders, and they can be accessed directly. This is normal behave.

@svitcov: your img-urls have no filename, something like myimagename.jpg!

Edited by horst
  • Like 1
Posted

@Horst: I thought he was using a PHP file outside the PW system (i.e., I didn't know it was a template file).

@Svitcov: What is $slide? How does your other code look like just before what you have shown us above?

  • Like 1
Posted (edited)

Out of curiosity, try this instead

<?php echo "<img src='{$slide->image->url}'/>";?>

But your code above should also work actually

Edited code above to add {}

Edited by kongondo
Posted

Ok, it was a simple configuration error. I had max files set to 0 instead of 1 (I meant for it to be a single image, not multi). Thanks for the help!

Posted

Is that a dev site by the way? The slider image sizes are massive (parliament-1.png is 4MB; cliff-1.png is 5.8MB!) and are taking time to load. Just wondering...Beautiful site btw :)

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...