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
1 answer
16 views

Assets display changed, cutting off folders

I am not yet able to upgrade to Craft 4 due to some plugins used regularly not being ready, but on updating 3 to a newer version a few weeks ago, noticed the way asset folders were displayed - both on ...
0 votes
0 answers
15 views

Move asset not working (Craft 4.4.4) [closed]

Concerning Craft 4.4.4 It's not possible to move an asset, because the move button (German: "Verschieben") is disabled. Can anyone confirm this effect? I can't see any setting in Craft to ...
  • 21
1 vote
1 answer
33 views

How to get second asset in Craft CMS 4?

In craft cms 3 we could use this: {{ entry.images[1].url }} But how can I get second asset in Craft CMS 4?
1 vote
2 answers
50 views

Showing related assets referred to within Redactor (rich text) fields

When an entry includes a reference to an asset, like an image, that information is tracked and displayed. (The included screenshot shows where that reference would be, although this particular entry ...
  • 592
0 votes
0 answers
23 views

Is it possible to restrict a File System’s or Assets Volume’s file type?

I think I know the answer to this is “No” but I’m interested to know if I’ve missed something or whether I should turn this into a feature request. I know I can restrict file type for an Assets field ...
1 vote
1 answer
37 views

Asset Indexing is frozen and I can't discard the task

I'm using Craft 4.3.6.1 and a DigitalOcean Spaces filesystem. On the Utilities > Asset Indexes page, I clicked "Update Asset Indexes" button. A procress started and got about 3% done ...
1 vote
3 answers
95 views

Change asset title and filename on upload

I'm trying to rename files uploaded by users on the frontend. Changing the title is working, but I can't rename the file. Would appreciate some help! Event::on( Asset::class,Asset::...
  • 444
1 vote
1 answer
44 views

Prepopulating image fields - Formie Plugin on Craft 4

I have a front end entry form for users to update their entry. It's built using the Formie plugin. I need the fields to prepopulate with the current entry content. According to the Formie docs fields ...
0 votes
0 answers
31 views

Feed Me: import Assets custom fields data while importing new Entries

I have a JSON feed that import new Entries. In the imported fields, I have an image Assets field which is set up to create assets from their URL. "cover": [ { "url": "...
1 vote
1 answer
44 views

How to get list of pages where the asset is used?

I have a list of assets link with assets id. eg: 23453 => 'https://some_cool_domain/assets/file_name.jpg' I need to find all the pages where this asset is being used. I am new to craftcms. I tried ...
0 votes
0 answers
27 views

Retrieve storage path of image transform instead of URL

I'm generating base64 encoded strings of very small image transforms to display a blurred version of images while the bigger asset is loading. I'm trying to get the cached transform path (if it ...
  • 121
1 vote
1 answer
26 views

Detect on which entry / entries an asset is inserted

Is it possible to display in the asset overview on which entry / entries an asset is used? So that when I go into an asset, I have an overview of the entries where that asset is inserted.
1 vote
1 answer
33 views

Set asset volume dynamically via module depending on uploaded file kind

I'm trying to set the asset volume dynamically for new assets, using a module. I would like the volume to be based on the asset's file kind – in my case, automatically putting MP4s into a 'Videos' ...
0 votes
0 answers
23 views

AWS Load Balancer - Assets Uploads

We have two ec2 instances and a private IP db instance along with a Amazon Load Balancer. Is there a way to upload images on CraftCMS domain pointing to a load balancer? Right now the assets image ...
  • 1
0 votes
1 answer
37 views

How to enforce subfolder names for uploaded assets in hierarchical related sections

My goal is to ensure uploaded videos are organized into folders like: /Show/Season/Episode/videofile.mp4 Or stated another way... /{{ Show ID of grandparent }}/{{ Season ID of parent }}/{{ Episode ...
  • 139
1 vote
1 answer
88 views

How to rename an asset on file upload Craft 4

I am looking to update some custom module code which updates the file name on upload. In Craft 3 I had this working by listening to the EVENT_AFTER_SAVE on an Asset. It would detect the ID of the ...
  • 449
0 votes
0 answers
19 views

Can assets with no volumeId that appear orphaned be safely deleted?

Querying the craft_assets table shows 29 assets in a project that appear orphaned, we recently discovered that the temporary uploads location was set to the /storage path but this wouldn't work well ...
  • 1,101
1 vote
2 answers
80 views

Is there a way to block access to assets by url?

This will probably not be possible, but here goes nothing: I have entries that are password protected using the Template Guard plugin. While this does work perfectly, this does only password protect ...
  • 58
0 votes
2 answers
93 views

Get Entry Slug from specific Locale

I have a multilingual entry setup using different sites for each language. I want my assets sorted by slug, but since the slugs are different in each language, all assets are saved three times. My ...
  • 43
0 votes
0 answers
33 views

Asset subpath to top most parent

For the asset subpath in the assets field – is there a way to store assets to the top most parent slug? I have a site built up as a multi-layered structure and want to group all assets by their top ...
  • 43
0 votes
1 answer
53 views

Multiple image are automatically created?

I am using Craft 4 and I noticed after uploading an asset, additional folders are created automatically with multiple sized versions of the same image I uploaded. This causes a lot of additional files ...
1 vote
1 answer
35 views

Craft changing/corrupting assets on download?

I have a problem with downloading files from Craft CMS using the "download asset" action on the asset page in the control panel. These files don't have a public URL and needs to be ...
  • 87
0 votes
0 answers
33 views

Query multiple users and inner join to assets field

How to query multiple users and join to assets field? I want to query users with IDs [1,3,4] and inner join it to assets field with volumeId 5 and titles [1,3,4]. Tried this but this is probably wrong ...
  • 101
0 votes
1 answer
51 views

Transformed JPGs have larger file size than original

Question Why is it that sometimes a transformed JPG is larger than its original when it is transformed using Craft image transforms even though in my general.php file I set upscaleImages to false? ...
  • 58
1 vote
1 answer
43 views

Craft 2 Looping Through Assets Limit 100

In Craft 2, I am looping through Image Assets, but the loop stops after 100 images. I currently have around 140 images, but only the first 100 appear. Is this a built in limit in Craft 2? Thanks {% ...
  • 380
1 vote
1 answer
433 views

Craft4 stream_copy_to_stream(): Argument #2 ($to) must be of type resource, bool given

As mentioned in the title, I'm not able to upload any files in Craft4. I created a filesystem and a volume which is connected to the filesystem. In the assets-field settings I added the volume. I have ...
  • 31
1 vote
1 answer
55 views

Hosting and permission problems

It's my first time deploying CraftCMS and I ran into some issues which I don't seem to fix. I'm using Combell to host my website. I can only access my site when I go to "sitename".be/web/ . ...
  • 11
1 vote
1 answer
277 views

Why am I getting, 'Unable to write stream to' error when uploading asset?

I set up Fortrabbit object storage but when I go to upload an image in 'add asset' I get this error in a pop up; Unable to write stream to 'fileName' When I try to upload it with 'upload asset' the ...
1 vote
1 answer
82 views

How do you upload an asset via an API or GraphQL

Is it possible to upload a new asset via some POST request to craft's API? Or maybe through a graphql mutation? I noticed in the public schema there is the option for Creating assets within a volume. ...
1 vote
1 answer
166 views

What's the correct way to check that an asset file exists?

If I have an asset resource, loaded successfully from the database, whose corresponding file no longer exists on its Volume (irrespective of Volume type), what is the best way to find out if the file ...
  • 43
0 votes
0 answers
37 views

Asset management for big projects

We have been doing big Craft & Commerce projects lately. From a number of our clients, we receive feedback about the asset manager. The asset manager worked properly for the smaller projects, but ...
  • 1
1 vote
1 answer
145 views

Creating an asset from an API using a module

I'm currently making a module that I'm hoping is going to create entries and assets from an API. I've got the entries part working and now I'm trying to create an asset from a URI of an image. I've ...
1 vote
1 answer
36 views

How can I use a transform on images in a body field that have been imported?

I have imported content into an old news entrytype for a news channel. The odd image in the body field is 4000px wide. Is there a way of automatically transforming these in a template or from the CLI? ...
  • 1,932
3 votes
1 answer
229 views

Eager loading categories and assets inside related entries for gallery

I am looking for some advice on how to best streamline a gallery system on a site, but having trouble wrapping my head around the syntax needed to eager load nested asset fields with categories inside ...
1 vote
1 answer
16 views

Asset has a child category but only displays the parent on templates

I have an asset volume that has a category field. The category field has no max level so I can have parent/child categories. If I set a child category to the asset in /admin then all is well, but when ...
  • 147
0 votes
0 answers
127 views

Upgrading Craft (and docker image) now causes SIGSEGV core dumps and problems with mutex locks

I just upgraded to 3.7.27.2 (as an intermediate step) and since I'm always deploying with the latest docker image (craftcms/nginx:7.4) I have also gotten the latest expat upgrade. I'm not sure where ...
  • 253
0 votes
0 answers
51 views

How to save the selected assets in custom module

I am trying to create a custom module where I have created an asset uploader field. Images are getting uploaded with that field but not saved. class Settings extends Model { // Public Properties ...
  • 1
1 vote
1 answer
287 views

Get the width and height of videos

I need to get the width and height of videos to calculate some aspect ratio. Craft doesn't do this out of the box. Any plugins that does this? Or can i write my own?
1 vote
1 answer
107 views

Asset Custom Field Returning Null in Array

I am relatively new to Craft CMS and I have encountered an issue that I have attempted to debug for quite some time. When using the {% dd %} function to dump my array, a load of my custom fields ...
1 vote
1 answer
66 views

Display entry field if it contains search query

Is it possible to display an entry field in search results if it contains the search query? Context: I have an entry with a list of PDF assets. I want to show an asset in the search results if it ...
  • 13
0 votes
1 answer
187 views

Want to use assets field my template settings in custom plugin craftcms

I am creating a plugin that is based on images the admin will upload some sort of images in plugin settings not sure how to creat image field setting in plugin
  • 23
1 vote
1 answer
56 views

Remove dynamicly transformed images

Is it possible to remove/delete all, via transformer, generated images? Leaving the original be. Craft creates new directories to handle these images. So i could create a script in combination with a ...
  • 421
0 votes
0 answers
25 views

Local Volume Folder: Transliterate path, but keep name as is

Intention: create a local Asset Volume with a bunch of subfolders and files in it and display a file tree on frontend. All OK, but since the website is in German, I have to do 'convertFilenamesToAscii'...
  • 55
1 vote
0 answers
128 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? ...
1 vote
1 answer
95 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/...
  • 29
1 vote
1 answer
79 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 ...
  • 444
2 votes
1 answer
430 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
1 answer
167 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
1 answer
32 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 ...
  • 315
2 votes
1 answer
44 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 ...
  • 167

1
2 3 4 5
17