Questions tagged [assets]

Files managed by Craft, stored in physical folders or (with Craft Pro) on Amazon S3, Rackspace Cloud, and Google Cloud.

Filter by
Sorted by
Tagged with
0
votes
0answers
50 views

Specify an asset volume for a file input on a front-end entry form

Is this possible? I want to specify the volume and/or folderId via hidden input, not just use the default. Nothing documented here: https://docs.craftcms.com/v3/assets-fields.html#uploading-files-...
1
vote
1answer
55 views

How to reference a folder inside of a volume, Craft 3

How do I reference a specific folder (by name) inside of a specific volume. I cannot use the folder ID, I must use the folder name because the name of the folder is a variable related to specific ...
1
vote
1answer
96 views

alternative global variable to siteUrl or the primary website?

I am currently developing a multilingual craft website. To include assets like styles and scripts, I have so far built the URL following the pattern "{{ siteUrl }}/assets/css/main.css". However, as ...
1
vote
1answer
23 views

entry / asset url integrity check

Is there any mechanism in Craft (or a plugin) which protects entries or assets from being deleted, if they are used in an asset / entry field used in an entrytype, global, ...? Or is there a way to ...
0
votes
0answers
47 views

Best multi-environment approach using AWS S3

I need some direction on how best to run multi-environments with Craft assets and static asset builds (JS, CSS, etc) going to S3. I have three environments: dev, staging, and production. Each have ...
1
vote
1answer
58 views

how to check for the 2nd, 3rd, 4th… image in an asset's field

I am currently "translating" our current website, which runs on the lastest expressionengine, to craft. we use imagegrids that are arranged by css. so in an entrie's pulldown field choose between ...
1
vote
1answer
208 views

GraphQL two image transforms for same field

To get image transform in GraphQL we use this image { url @transform ([width: 300, immediately: true]) } But how do I get two different image transforms (for responsive image) for this asset ...
0
votes
0answers
16 views

Craft 3, Freeform entry not created but file gets uploaded

I have a freeform form that submits an entry. If I submit without choosing a file to upload, the entry gets created fine. If I submit the form with a file chosen, the file gets uploaded to the proper ...
0
votes
0answers
31 views

Find unused asset volumes

Is is possible to get a list of asset volumes that aren't being used by any fields? I often reuse a base Craft install when starting a new project and being able to quickly cleanup volumes that are no ...
0
votes
0answers
28 views

Localized slug in dynamic asset path

I'm trying to save images in a folder name based on their English slug (or title), to avoid having duplicate folders with titles in different languages. In Craft 2 I did {{object.locale('en').title|...
1
vote
1answer
125 views

How to reference specific asset subfolders in Craft 3

I am having trouble referencing specific subfolders in Assets in Craft 3 using Twig. The query that I've written is still showing all content, when I only want it to show content from a specific ...
1
vote
1answer
28 views

Amazon S3 plugin uploading to different directory

I was using Amazon S3 with Craft 2 fine, now after updating and installing the plugin I am having issues. We use a folder inside our bucket as the root Assets location - e.g. /bucket-name//folder ...
2
votes
1answer
368 views

How do I dynamically define Asset Volumes' Base URLs for different Sites?

There must be a simple answer for this but despite fumbling around with it for quite a while and searching the web for answers I am stymied. Perhaps I'm approaching it in the wrong way. I'm feeling ...
1
vote
1answer
26 views

Image thumbnail generation (on S3/Cloudfront integration) returns blank when first generated

For a client site with S3/Cloudfront integration, we are seeing that images will not be able to load for the first time if they have not been generated before. I'm guessing this is because it takes ...
2
votes
1answer
63 views

How to get image url from matrix field

I have an image in a matrix-field, but can't get the url from it. dump(block.image.one().url) says NULL. My code is: {% if entry.hero %} {% for block in entry.hero %} {% if block.type == 'hero'...
1
vote
1answer
113 views

How do you output the Image Caption on an asset?

When you double-click an asset you can set the Image Caption: How do you structure the query to output this Image Caption "field?"
0
votes
0answers
185 views

Internal Server Error - The file does not appear to be an image

On a live environment I'm hitting an error when uploading some jpg images, which wasn't a problem on dev or production. I can get around it by re-exporting the image out and keeping it under 1mb, but ...
1
vote
3answers
125 views

How can I restore Matrix content after accidentally changing its field type?

We accidentally deleted all our body text on all our pages, how do I redo my website to a older version. (24 hours ago) We changed matrix to assets and after that every body text disappeared.
1
vote
1answer
31 views

How to toggle main product image from multiple images

I'm having some trouble figuring out how to properly update the main product image from a set of images that are available. Within the product detail page, I have a large default image that is shown ...
1
vote
1answer
25 views

Craft Pro 3.1.33 - Download PDF in admin user profile

In Craft 3 Pro i need to download a PDF file that a template form submits to active user profile. The PDF submits from the front and goes to the admin area under the user account profile. The ...
1
vote
0answers
71 views

Craft 3 Image Editor / Redactor - Remove?

TL;DR Can the button for "Image Editor" be removed from Redactor in Craft 3? I've looked around the Craft docs and web, but I can't find a way to remove the button that appears within the Redactor ...
1
vote
1answer
72 views

Use Service Worker in Plugin

I am currently working on a plugin that uses a service worker which gets registered on the front-end by some javascript code and the problem is that the service worker scope is restricted to /...
1
vote
1answer
52 views

AWS Serialisation error on front end

Getting the following error on a site I'm developing: Instances of craft\awss3\S3Client cannot be serialized Unsure if this is an issue with the Amazon S3 plugin or at my bucket's end. Any ideas ...
3
votes
1answer
1k views

Error on upload: “Impossible to create the root directory…”

In Craft 3.2.10, I'm getting this error message when I try to upload an image asset: Upload failed. The error message was: “Impossible to create the root directory "/Users/me/Work/Client/repo/web/...
4
votes
1answer
147 views

What is “Temp Uploads Location” in Craft 3.2.10

In Craft (Solo) 3.2.10, In Settings > Assets > Asset Settings, there's a field called "Temp Uploads Location". I do see images in mine that I intended to go into the system, but not into there. What ...
1
vote
1answer
191 views

How do I set up Craft 3 to web server in WAMP?

I'm very new to Craft CMS, and I certainly love this concept! However, I keep trying to run it locally onto my computer following the documentation here https://docs.craftcms.com/v3/installation.html ...
1
vote
1answer
137 views

When to create a new asset volume?

I'm not sure if I've been using asset volumes correctly. For each folder inside my /uploads directory, I've been creating a new volume. So they're all relative to /uploads I have volumes for things ...
1
vote
1answer
27 views

What purpose does the site-selector under assets fulfill?

I'm kind of confused about the site selector under Assets, because from what I can gather it actually doesn't do anything? See this screenshot, top left: I was first under the impression that I would ...
1
vote
1answer
58 views

Multiple Images/Assets from Super Table?

I have a Super Table "previewImage" with a field "previewImageFile". This does not work: <ul class="col-lg-12"> {% for subsection in entry.descendants.descendantDist(1).all() %} <...
1
vote
1answer
109 views

Get an Asset's Filename Without the Extension

How do I get an asset's filename without the extension? So if my filename is my_cool_photo.jpg I want to return my_cool_photo. Using {{ entry.assetsField.one.filename }} returns the name of the file ...
1
vote
1answer
61 views

Craft criteria for asset folders

In my plugin, I would like to search a folder. However, I cannot find any information about the criteria for folders. Are there any documentation or something? $n = Craft::$app->assets->...
0
votes
1answer
189 views

Assets in Super Table not working

I have a assets field in a Super Table. But the output from the image i selected in the Entry is just garbage: O:28:"craft\elements\db\AssetQuery":82:{s:8:"volumeId";N;s:8:"folderId";N;s:8:"filename";...
2
votes
1answer
2k views

Upload failed, fopen – failed to open stream: Permission denied

When trying to add assets in the live admin I get the following error: Upload failed. The error message was: “fopen(assets/images/general/IMG-2483_190715_161352.jpeg): failed to open stream: ...
1
vote
1answer
78 views

How to place assets in plain text fields?

In ExpressionEngine i had a matrix field for images (assets) that i used in my entries. I was using NSM Transplant and in my entries i could use {bild-1}, {bild-2} and so on wherever i wanted a image ...
1
vote
2answers
203 views

Updating Asset Indexes Fails with TemplatesController Not Found Error in Craft Logs

Client wants to be able to upload a 90MB .mp4 file to a local asset folder, that understandably throws a 'General error: 2006 MySQL server has gone away'. I uploaded the file directly to the server ...
1
vote
2answers
171 views

Rename Assets when it is uploaded

I would like to rename new assets by PHP, but somehow it does not work. In Craft 3, I suppose it is like; Event::on(\craft\services\Elements::class, \craft\services\Elements::EVENT_AFTER_SAVE_ELEMENT,...
3
votes
1answer
339 views

Asset Volume using Environment Variable on File System Path as literal string on upload

I have a volume called "Website" with a File System Path that uses an environment variable, $ASSET_ADHOC_PATH. The variable has been setup in my .env file as follows: ASSET_ADHOC_PATH="/home/theadhoc/...
1
vote
1answer
94 views

Asset Filename Query using Product SKU

I'm moving an e-commerce site over from EE. Many of the products have a "product image". Many do not, but we have an assets directory full of images that match their SKUs. When listing the products ...
2
votes
1answer
68 views

How to restrict uploads to currently edited site

I've tried /{{currentSite.handle}}/ but this uses current site handle, not the site I'm currently editing. Is there a way to dynamically set folder to currently edited site?
1
vote
1answer
601 views

How to do CSS/JS bundles/minifying in Craft 3

I would like to combine all of my sites JS-files into one bundle - and perhaps also obfuscate it. Same goes for CSS-files. How would I do that in Craft CMS 3?
1
vote
1answer
36 views

Uploaded Assets always get 600 File Permission and are therefore not displayed (403 Error)

After a fresh manual Craft CMS install everything runs fine, except uploading Assets. Well, the uploading part works fine but uploaded assets always just get file permissions of 600 (adfrw) Group and ...
1
vote
1answer
15 views

some assets have volumeId set to NULL in database

I noticed that some of my assets have volemeId column set to NULL in the database table assets. Is it normal? Should I attach them manually to some volume?
2
votes
1answer
68 views

Plugin that lets user select focal point/cropped area

I would like to let the editor of a specific entry select the focal point and cropped area each time she selects an asset for an asset field. How can I achieve that? I know about the built in ...
1
vote
0answers
66 views

How do I correctly upload a new Asset from a temp file I generated from a service method?

Preamble Craft 3.1.26 PHP 7.2.8 on Mamp Pro 5.1.1 I browsed to my storage/reports folder and made sure in Finder than full read/write privileges are granted. What's goin on I have a module with a ...
0
votes
1answer
108 views

An unknown error has occurred in asset reindex

I am getting the error: An unknown error occurred for each file in a folder when I try Update Asset Indexes. The folder is a local folder that is outside of webroot. The files just contain json data....
2
votes
1answer
352 views

Multi-site - Setup remote asset volume to store assets on a per site/folder basis

We've got a Craft 3 (3.1.25) multi-site setup with three sites: Corporate (default) Brand A (brandA) Brand B (brandB) For this install there's 3 users setup with the following access to the sites. ...
0
votes
0answers
65 views

When trying to create a new asset volume, I don't have the form line where to put the path

As per the question, see the included screenshot: I just don't have the URL form to type where the volume should be on the server.
1
vote
1answer
204 views

Assets Error: Unknown or bad format (years) at position 0 (y)

I am getting a new error, after no apparent updates from me or the client. The error only appears on pages with this one particular field. "DateInterval::createFromDateString(): Unknown or bad ...
1
vote
1answer
53 views

Error creating new volume

When creating a new volume (same process as the other 3 volume I currently have and which are fine, I'm running into the following error). Any help would be appreciated.
2
votes
0answers
322 views

How to download private assets (without public URL) from dashboard

I would like to download asset files from Craft 3 dashboard. Those files are out of web folder because of security reason. I made "documents" folder just under the root of the project, and the files ...

1
2
3 4 5
16