Forum

Thread tagged as: Question

Assign bucket to uploaded image

Hello,

I am trying to assign Resource Buckets to uploaded files, however I am not sure my .html template is correct.

Here is my template:

<div class="<perch:content id="imageclass" type="select" label="Class" options="images,images images1,images images2" help="Select top margin for the image"/>">
<div id="<perch:content type="text" id="picture_id" label="ID" required="true" help="Enter StyleSheet ID for the picture"/>">
<picture>
<source srcset="<perch:content id="_id" type="file" label="WebP image"/>" type="image/webp">
<img src="<perch:content id="_id1" type="image" bucket="<perch:content id="imagebuckets1" type="select" label="Bucket" options="bucket1, bucket2, bucket3" allowempty="true" help="Select bucket for resource"/>" label="JPEG image"/>" alt="<perch:content type="text" id="alt" label="Alternate Text" required="true" help="Define alternate text for JPEG image"/>">
</picture>
</div>
</div>

When I allow a Bucket to be assigned, only the WebP image can be uploaded.

If there is no way to manually assign a Resource Bucket to an uploaded resource, I would very much like to know, otherwise if there is another way I'd appreciate knowing.

I started reading about Perch Categories, would that be more what I am looking for?

Thank you for any assistance.

P.S. I think what I am trying to do is mentioned here: https://forum.grabaperch.com/forum/03-12-2016-buckets-locally-and-live

Garth Holmes

Garth Holmes 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You can't nest tags inside each other like that, no.

You don't upload a file and then "assign" a bucket to it. Resources are uploaded to a bucket. The bucket is literally the folder the file gets uploaded into.