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
1
vote
0answers
16 views

How to save custom field for asset field in entry form

I have an entry form that includes an asset field called photoHalfBlock. The asset field has its own custom field called photoType. Can I set a custom field on the asset as part of my entry form? ...
0
votes
0answers
15 views

Get asset info from Transform ID

I'm getting a handful of 'Image transform cannot be created' errors, and would like to know which original images these are to see if there's a specific reason - is there a way to output which asset ...
1
vote
1answer
23 views

Asset Indexing breaking images

My client hit the update asset indexing button in the settings panel and now the images are all appearing broken. Can you suggest how to fix this? Example image: https://cookproperty.co.nz/assets/...
0
votes
1answer
18 views

Dynamic Assets location path for entries & Commerce

I have a Matrix that I use for both Entries and Commerce Products. Inside of that Matrix is an Assets field. Currently, I have {owner.parent.uri ?? owner.section.handle}/{owner.slug} which works ...
2
votes
1answer
22 views

How to show all files from a subfolder in craft Backend

I'm new in Craft CMS and i want to know if it's posssible to loop every file which is in a subfolder in the Backend media folder? For Example: Show me all files in Backend/craft/web/media/images/...
1
vote
1answer
24 views

Link uploaded file to an entry field

I want a user to upload a PDF file to his request. On the backend, I can manage to save the file on server, but I'm looking for a way to save it in the Entry just as if I was doing it manually on the ...
1
vote
1answer
22 views

Access Asset Type for subfolder

I want to create asset subfolders by page & by asset type. I use an asset field in an matrix field for multiple asset types like video, images etc. In an asset field I can access the slug of an entry ...
2
votes
1answer
26 views

Querying media asset in module

I'm learning to write my own modules, so there's a lot that I still don't know. I have looked at other modules/plugins, videos, but I arrived at a dead end. I'm writing a module that generates ...
1
vote
1answer
38 views

What does "Allow self relations" on Asset fields mean?

In the Advanced section of an Asset Field configuration, there is the "Allow self relations" checkbox. What does this do? I've noticed that when I have the Propagation Method of the field ...
1
vote
2answers
55 views

Generating srcset in a similar way to WordPress

I come from a WordPress background, so I'm attempting to create responsive images the way I'm accustomed to with WordPress. Perhaps that's the wrong approach, I'm not sure. In WordPress I would ...
0
votes
0answers
17 views

Error uploading to asset field from front end form

I'm getting an error when uploading to an asset field from a front end form during entry creation. SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type integer: "...
1
vote
1answer
28 views

Split Assets volume into two

I've got a site where all the images for all the entries were added to a single, monolithic "Uploads" Asset volume, and I need to separate staff-uploaded images from user-uploaded images so ...
1
vote
1answer
29 views

Craft site in subfolder of domain

Unusual use-case - but I have a client with two websites they're merging into one. Their aim is to make the Craft 3 site (currently on its own top level domain) run in a /distribution sub folder. I've ...
0
votes
2answers
61 views

Bootstrap 4 Modal show same image, regardless of thumbnail selected

I have the following code that's mostly working: {# # Decades category template # ------------------- #} {% extends "_layout" %} {% set title = "Decades" %} {% block content %} &...
1
vote
1answer
31 views

Reading transformed image data in plugin

I'm working with images in a plugin but getting a bit stuck reading a transformed image. Given the following code: $assetTransform = new AssetTransform([ 'mode' => 'stretch', 'width' => ...
0
votes
0answers
19 views

Assets uploaded only to temp folder (first upload only)

I have a Craft installation (v3.7.4) with an Amazon S3 plugin (v1.2.12). I have an asset field configured to upload to an Amazon S3 volume. IAM roles are properly configured, files get uploaded to S3 -...
2
votes
2answers
70 views

Enupal Snapshot: Fail to save setting for Craft Nitro with status code '127'

I keep having issues when trying to save the settings for Enupal Snapshot at Craft Nitro, Below is the error message I found at the log file, [enupal\snapshot\Snapshot::error] Something went wrong ...
1
vote
1answer
28 views

Cache Excesive Assets Size

I have only been using Craft 3 for a short time and I am currently the webmaster of a too big news site. I just checked that the /storage folder is almost 80GB in size. All the size is in the /storage ...
1
vote
1answer
26 views

New assets field not showing up for some users

I've added an assets field to an existing channel that shows up fine for me on both the new entry and editing existing entries, but it's not showing up for some users. I've cleared cache in Craft ...
1
vote
1answer
31 views

How do I get the content from a text or html file in an assets directory to be displayed?

I'm looking to display/print the contents of an html or text file uploaded into assets. Not sure what parameter to access though. Any help would be much appreciated!
1
vote
1answer
54 views

Rename Assets on Import?

I'm using Feed-Me to import a json file from Instagram. The filenames I get for my images from Instagram are MEGA long. Feed-Me is also changing any _ in the name to a space. I'm looking for a way ...
0
votes
0answers
33 views

Automatic Asset Cache Clear

I have a large website that various users need to upload important documents (assets) to frequently. I need to have the Craft asset cache clear every time a new asset is uploaded. The other option I'...
0
votes
0answers
37 views

craft cms how to modify redactor image upload path

So for my assets field types, I have the Asset Location (Where selected assets should be stored.) set to: {owner.type.name}/{owner.slug} this neatly puts all the files I upload via the asset field ...
1
vote
2answers
55 views

How to upload animated webp files?

I've created an asset volume to which I can successfully upload jpgs, pngs, static webps etc. But when I try to upload an animated webp I get the alert: Upload failed. The error message was: “The file ...
1
vote
1answer
87 views

Search for assets containing a custom field

How can I search for assets containing a custom field? The field on the asset is called lang. When I use this code no assets are found. {% set folderId = craft.app.request.getQueryParam('folderId') %} ...
0
votes
0answers
14 views

When Asset is Located in Root of Asset Volume - asset.getPath() Does Not Return the Volume as Part of the File Path

Context Asset Volume: staff (I'm using an S3 bucket as the source type) Image location: staff/john-smith.jpg Version: Craft 2.7.8 Results I expected that this query {{ staff.portrait[0].getPath() }} ...
1
vote
1answer
54 views

How would I detect whether an entry's asset field has been updated on save?

We need to send a notification email when an entry's asset field, Custom Image, has been updated on entry save. We're able to do this consistently for text fields but I'm having trouble doing the same ...
1
vote
1answer
50 views

Serve remote files instead of local ones (with a nitro setup)

I'm new to CraftCMS and slowly learning how to use it. I'm creating a site. The local setup was done with Nitro. I have read about the ways to synchronize data and assets across environments. But I ...
0
votes
0answers
23 views

Image thumnail not found(404) issue. What causes the header to set as image/svg+xml instead of png/jpeg?

Thumbnails not loading in assets list in my control panel with my host platform.sh(works in my local docker env). Call to index.php?p=admin/actions/assets/thumb&uid=29dad26b-ba90-4b26-b9fb-...
2
votes
1answer
131 views

Showing and playing video's in Twig templates

I want to be able to upload and play videos on my Craft CMS website. I created a volume and field to hold these videos. So far so good, but whenever I want to output the video in a video tag I'm not ...
1
vote
0answers
33 views

Is there a way to prompt for confirmation in cp?

I have a custom plugin that checks for assets filename, and I'd like to prompt for confirmation like in the example below. Is there a way to do that in Cp? If user clicks No then $event->isValid = ...
3
votes
1answer
42 views

How to fetch all assets that are in use, via a specific field

We have a channel of entries which all include the same asset field. We are trying to fetch all assets that are actively in use, ergo the assets which have been linked to any of the entries in the ...
1
vote
0answers
73 views

Changing assets location in entries after moving them to a different volume

I've moved all the assets from a local volume to a DigitalOcean space (S3 compatible) and all new entries are using that volume. I've updated all assets fields to use that new location. My problem is ...
2
votes
1answer
35 views

Getting assets from an entry programatically

I want to get the id of an asset I've set for a feature image on an entry. To find the entry I'm using the slug as the criteria like so: $entry = Entry::find() ->slug('0002') ->one(); In ...
2
votes
1answer
62 views

Assets S3 Cache Duration and CP Thumbnails

What does everyone consider a sensible cache duration to use when using Assets with S3/Cloudfront? Is 3 hours sensible or should it be longer? Secondly, does this have any impact on the assets being ...
1
vote
1answer
69 views

Craft CMS - 3.6.11.1 - Why are Assets Backed Up to Temporary Storage?

Since updating Craft CMS to the latest version I noticed that our uploaded files get backed-up daily to temporary storage. Uploaded files live on DigitalOcean Spaces so we have no need to back up ...
1
vote
1answer
31 views

Craft adds unwanted date to filename

How to remove the date behind a asset filename or prevent add a date behind the filename? I'll have a plugin that's modifies an existing pdf with SETA SIGN. To do so I'm copy the current asset, modify ...
1
vote
1answer
58 views

Importing data from an old EE site

I've been asked to export some data from an old EEv2 site into a Craft site. I thought I should be able to export the data from EE into CSV or XML and then use FeedMe to import it. But one of the ...
1
vote
1answer
32 views

Upload file issue on Craft 2.9.2

This issue is occurring on Craft 2.9.2. The assets are stored on Amazon AWS (S3). When I try to uploaded a new asset (of any size, even very small), the progress bar moves to 100% position but remains ...
0
votes
0answers
16 views

Can't delete sub folders

I have an issue where I cannot permanently delete a sub-folder from the "Assets" section in the control panel. When I delete the sub-folder, it does delete, however after logging out or a ...
1
vote
1answer
35 views

How to hide the assets section of the control panel to specific user groups?

I need to hide the assets section of the control panel to a given user group. Changing the group permissions to prevent them from viewing all asset volumes also prevents them from uploading assets in ...
1
vote
1answer
63 views

How do you insert the site name into a default asset path?

Multisite question.... how do I output the site into the assets path? currentSite won't work because its the admin panel, so the current site is always the default site. Using the below, I will always ...
1
vote
1answer
71 views

Get image asset relative url

I'm using image transforms and getUrl() method to display an image. I'm using Blitz to export my site as a static website. My problem is that .html pages get cached with images that have full urls ...
0
votes
0answers
85 views

Trouble generating correct srcset sizes using getSrcset()

I'm trying to figure out the getSrcset() method, going by the docs here. When I try it using the code in that example (I modified to account for a Matrix field but other than that it is the code below)...
2
votes
1answer
48 views

Deleting one or all Assets from a fieldusing a front end form

Good afternoon All, Im trying to setup the ability for users to delete 1 or more of their own images from a multi photo asset field and have got stuck. This is what is have so far, I assumed adding a ...
1
vote
1answer
76 views

Display list of assets that are in use?

I am very new to Craft and how it works. I've got a client with a Craft site (v2.9.2), that I help them with. It was created by another developer. I want to help them tidy up their Assets. There are ...
0
votes
0answers
21 views

How to empty the Temporary Uploads folder and why can individual users not delete files within up this folder?

I am perhaps over looking something, but I cannot see anyway for an back-end user (not admin) to be able to remove/clean up their Temporary Uploads folder. As a full admin, I see the option to remove ...
1
vote
1answer
30 views

Does deleting an original asset but keeping the transform folder asset make Craft replace the original file with the biggest transform?

I have a client who has uploaded many giant images to the CMS (8mb+). I'd like to free up that space now that those image have been transformed to more web-friendly sizes. Is it safe for me to delete ...
0
votes
0answers
12 views

Updating uploaded assets directory structure

How can i update uploaded assets directory structure, when i change assets field "Default Asset Location" settings - so files match this new setting? I have so much files all in one ...
1
vote
2answers
97 views

How to Get Asset Volume Name

Trying to figure out how to get the "name" and "handle" of an asset volume, given the volume ID. Tried all the obvious things, no luck!

1
2 3 4 5
17