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
2
votes
1answer
19 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
15 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
31 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 ...
0
votes
0answers
14 views

Best practice for organizing assets, locally and in S3?

Asset organization "best practice" question: for a new site, I had planned to reuse as many fields as possible between sections. Now I see that means that I'm not able to separate uploads from ...
1
vote
3answers
32 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
17 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
13 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
21 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 ...
0
votes
0answers
25 views

Asset Focal Point from Front End

It is possible to set the focal point via the CP, but I am trying to allow non-CP users to edit their images. I have so far been unable to provide a focalPoint parameter while adding an image. Is this ...
1
vote
1answer
39 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 /...
0
votes
0answers
21 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 ...
2
votes
1answer
264 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/...
2
votes
1answer
35 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
45 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
44 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
16 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 ...
0
votes
0answers
16 views

Default sorting in Assets view

Is there a way to change default sorting order on asset view pages? At the moment the default one is Upload Date and selecting sorting by Title only affects view in the folder you're currently in. In ...
1
vote
1answer
26 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
44 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 ...
0
votes
0answers
26 views

Update asset index by PHP in Craft 3

In my plugin, I need to update asset indexes because it makes new asset folders. I found this question, but the answer is for Craft 2. How do you programmatically update an asset index? It does not ...
1
vote
1answer
33 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
55 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";...
1
vote
1answer
465 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
76 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
43 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 ...
0
votes
0answers
40 views

Download asset from a form

A few months ago, I developed a form to download asset. The form helps to download files from entry page or user profile page, as this question. Is it possible to have secure (private) assets? ...
0
votes
0answers
40 views

Can Feed Me search multiple asset volumes when importing entries?

I've manually copied and indexed assets from a previous CMS. I have an asset field with multiple selected sources. However, when importing entries with the assets field Feed Me only finds the file if ...
0
votes
0answers
16 views

How would override a single CP template?

I would like to override the "_special/image_editor.html" template, to allow more constraint possibilities. How would override this template ? Nicolas
0
votes
0answers
17 views

How can I upload assets assigned to a specific site?

I have 2 sites, site A and site B. When I upload an asset to site A, the asset is also visible in site B. How can I upload an image to only site A or site B? I am looking for a similar behavior like ...
1
vote
2answers
84 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,...
2
votes
1answer
113 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/...
0
votes
0answers
14 views

Entries are being saved even when I try to upload files with the wrong extension

My Image service function throws an exception and sends it to the Craft logger that the extension is invalid. But my entry is being saved even though the field is set to only allow images. I am ...
1
vote
1answer
46 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 ...
1
vote
1answer
50 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
268 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
22 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 ...
0
votes
0answers
22 views

Rename files uploaded to certain sources in Craft 3

I have an event written for Craft 2 which renames files, which are uploaded to certain sources, to have a 35 character random string, plus its original extension. I am looking to update this for ...
1
vote
1answer
14 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
29 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
44 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
0answers
45 views

Asset subfolder dynamic condition

I have a channel called Locations. I've created a matrix field to hold x amount of team members. I have the asset folder for the team member's picture saved to locations/{owner.slug}/team I would ...
0
votes
1answer
65 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
74 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
40 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
107 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
45 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
149 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 ...
0
votes
0answers
81 views

Assets uploaded image quality is terrible

When I upload a JPG image through Assets, the image quality is terrible. I dont mean a slight difference for web optimisation, but I mean REALLY bad! See screenshot. Can't find any helpful about ...
1
vote
0answers
24 views

Asset field - saving assets with dynamic subfolder by categories not working consistently

I have two asset (image) fields in project entry type, both with the same setting and with different outputs… Anyone knows why? Thanks My fields are: intro image field gallery image field Both ...
1
vote
1answer
29 views

Advice on entry form file uploads and S3

Just planning out an entry form that includes a file upload field – an assets field hooked up to an S3 bucket. I see some documentation on entry form assets here, but need some advice on getting this ...