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
0 answers
40 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 ...
user avatar
  • 33
0 votes
0 answers
28 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 ...
user avatar
  • 1
1 vote
1 answer
23 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 ...
user avatar
1 vote
1 answer
28 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? ...
user avatar
  • 1,886
2 votes
1 answer
39 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 ...
user avatar
1 vote
1 answer
13 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 ...
user avatar
  • 95
0 votes
0 answers
26 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 ...
user avatar
  • 213
0 votes
0 answers
26 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 ...
user avatar
  • 1
1 vote
1 answer
47 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?
user avatar
1 vote
1 answer
27 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 ...
user avatar
0 votes
0 answers
26 views

What's the recommended approach for applying effects on images and saving them in the respective volumes?

I'm creating a plugin in Craft CMS and it has a feature where you can apply certain image effects and after you are done, you can save it in the configured Asset volume. I know that ImagerX also does ...
user avatar
  • 23
1 vote
1 answer
38 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 ...
user avatar
  • 13
0 votes
1 answer
88 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
user avatar
  • 13
1 vote
1 answer
50 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 ...
user avatar
  • 359
0 votes
0 answers
22 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'...
user avatar
  • 55
1 vote
0 answers
39 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? ...
user avatar
0 votes
0 answers
30 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 ...
user avatar
1 vote
1 answer
29 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/...
user avatar
  • 29
1 vote
1 answer
40 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 ...
user avatar
  • 337
2 votes
1 answer
118 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/...
user avatar
1 vote
1 answer
40 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 ...
user avatar
1 vote
1 answer
29 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 ...
user avatar
  • 205
2 votes
1 answer
31 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 ...
user avatar
  • 157
1 vote
1 answer
64 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 ...
user avatar
  • 145
1 vote
2 answers
96 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 ...
user avatar
  • 111
0 votes
0 answers
33 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: "...
user avatar
1 vote
1 answer
30 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 ...
user avatar
  • 606
1 vote
1 answer
46 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 ...
user avatar
  • 131
0 votes
2 answers
66 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 %} &...
user avatar
  • 409
1 vote
1 answer
45 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' => ...
user avatar
  • 33
0 votes
0 answers
31 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 -...
user avatar
  • 1
2 votes
3 answers
104 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 ...
user avatar
  • 139
1 vote
1 answer
45 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 ...
user avatar
  • 13
1 vote
1 answer
55 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 ...
user avatar
1 vote
1 answer
76 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!
user avatar
  • 11
1 vote
1 answer
95 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 ...
user avatar
  • 103
0 votes
0 answers
54 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'...
user avatar
1 vote
2 answers
94 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 ...
user avatar
1 vote
1 answer
136 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') %} ...
user avatar
1 vote
1 answer
98 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 ...
user avatar
  • 438
2 votes
1 answer
88 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 ...
user avatar
  • 157
2 votes
1 answer
272 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 ...
user avatar
  • 55
1 vote
0 answers
35 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 = ...
user avatar
  • 413
3 votes
1 answer
56 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 ...
user avatar
  • 75
1 vote
0 answers
121 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 ...
user avatar
2 votes
1 answer
44 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 ...
user avatar
  • 53
2 votes
1 answer
92 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 ...
user avatar
1 vote
1 answer
86 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 ...
user avatar
  • 1,097
1 vote
1 answer
39 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 ...
user avatar
1 vote
1 answer
66 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 ...
user avatar
  • 499

1
2 3 4 5
17