1

I am having trouble setting up image volumes correctly in Hyperlane. My best guess is that is has something to do with permissions but I have not been able to find a solution.

This is how I have set up the image volume like instructed in Hyperlane's documentation enter image description here

However when I am uploading images it doesn't show in the templates, and when opening the url path I get a 404. You can see a page where I have uploaded an image here https://dev-craft3-f59ef5d673d0.hyperlane.co/work/nausea and when I right-click and open the image in a new tab I get a 404 https://dev-craft3-f59ef5d673d0.hyperlane.co/uploads/images/work/nausea.jpg

The template to get the image looks like this

  {% set image = entry.featuredImage.one() %}
  {% if image %}
  <div class="image-box">
    <figure>
      <img
      src="{{ image.getUrl() }}"
      alt="{{ entry.title }}">
    </figure>
  </div>
  {% endif %}

…and the field is set up like this enter image description here

1

In Craft, assets are always "absolute" paths to the webroot, not relative to the URL (although you can make it like that).

So in your example, @AssetPublicPath/images is going to be replaced with https://dev-craft3-f59ef5d673d0.hyperlane.co/uploads/images.

If you want something to go into a subfolder, in this case work, you'd need to either specify that as another Craft Volume or specify that in the featuredImage asset field.

Looks like have "restrict uploads to a single folder" checked but there's nothing set in that field so Craft is getting confused as to where to put things.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.