Questions tagged [assets-field]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
32 views

Assets dynamic location functions of site

In Craft 4.7.2.1 Pro, I try to create dynamic path location for my assets for my field "image". The field image is in MySection, which is shared with multiple sites. I would like to organize ...
emilie zawadzki's user avatar
0 votes
0 answers
20 views

Saving new asset as first index in assets field?

I have a front-end Entry form that has a file input for adding a new Asset to the Entry. It works fine except that I have the special requirement of wanting to add the new asset as the first index in ...
Brimby's user avatar
  • 343
0 votes
0 answers
161 views

Error while trying to create Assets/Asset Volumes

If I try to create a asset field, a server error occurs when I select the Field type "Asset" and I can't edit it further. I also can't edit my Assets because when I click on it I get an ...
Lucas's user avatar
  • 1
1 vote
1 answer
55 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.
ChuckLean's user avatar
0 votes
0 answers
55 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 ...
Noor M's user avatar
  • 1
0 votes
2 answers
313 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 ...
Sandro's user avatar
  • 43
1 vote
0 answers
195 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? ...
Michael Todd's user avatar
1 vote
1 answer
263 views

Upload asset via API - Asset saved under root folder

I am trying to seed some images to an existing volume programmatically. The code I'm using is taken (almost) verbatim from Craft's AssetsController@actionUpload: $filename = Assets::...
Matanya's user avatar
  • 472
1 vote
1 answer
35 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 ...
Sandwich's user avatar
  • 636
2 votes
1 answer
100 views

Asset upload hangs when uploading to asset field in entry

I wrote the following code in Module.php that checks if a file size is too large during an asset upload (the file size limit and asset volume handles are defined in a globals: a table with one column ...
berrydev's user avatar
1 vote
1 answer
328 views

How do you call an asset field from an entry Craft CMS 3?

I am wracking my brain here trying to understand the new documentation in Craft CMS 3 and the new way it handles assets from an entry. I have a page that creates a list of portfolio entries using ...
Stuart McCoy's user avatar
1 vote
1 answer
267 views

Feed Me and Assets Field - Mapping Trouble

I'm trying to import a JSON file to map a bunch of asset paths to their appropriate related entries. While I've followed the instructions in the docs, I'm still having trouble connecting the file ...
Ed Hebert's user avatar
  • 145
2 votes
1 answer
288 views

Import local image with FeedMe assumes wrong folderId

I am importing Entries from Google Spreadsheets and I have a column in my spreadsheet containing the filename of an image already existing in Craft. The import itself works, but images are not found / ...
Matthias Redl-Mann's user avatar
2 votes
1 answer
166 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 ...
cherrykoda's user avatar
  • 994
2 votes
1 answer
239 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 ...
springboynick's user avatar
1 vote
1 answer
107 views

Viewing Assets (PDFs) associated with an entry directly from that entry screen

I have a channel with an Assets field, designed to hold PDF files. It works fine to select one or more files, and/or upload files and select them. However, I'm wondering if there is a way to view a ...
4midori's user avatar
  • 656
1 vote
1 answer
70 views

Send currentUser id along with uploaded asset

I've created an entry form with an assets field. All works great, uploading to portfolio/{currentUser.id} directories. On edit forms I only want to list assets uploaded by the currentUser so the ....
Ian Ebden's user avatar
  • 894
1 vote
1 answer
195 views

Outputting SVG from an asset field inside a matrix field with svg()

I've set up an asset field inside a matrix field where a user can upload SVG icons, but I'm having trouble outputting them using the svg() function. {# Correctly shows the path #} {{ callout.icon[0]....
Jake1293's user avatar
  • 159
2 votes
1 answer
256 views

Front End Entry Form - File/asset field not saving when ajax submitted

I have a front end entry form which submits and saves fine when not using ajax. But when i do submit via ajax the text fields etc save fine but the file/assets field will not. I have stripped it right ...
mmc501's user avatar
  • 1,779
1 vote
1 answer
242 views

Asset volumes with dynamic subfolder

I have an asset volume which uses dynamic subfolders on the field level. I have an assets volume called 'members'. In a matrix field on the user profile tab there is an image field that sets its ...
Adam Menczykowski's user avatar
1 vote
1 answer
79 views

Outputting image assets with flickity

I'm trying to use flickity to create a draggable gallery on a single entry template, but I'm having issues with the output. In the backend it looks like this. A field using multiple assets. Without ...
Maggie's user avatar
  • 53
1 vote
1 answer
559 views

How to work getFieldValue for assets

I have been implementing my own PHP plugin code. In that, I need to get an asset field in user info. If I can get if the asset is set on the field or not, it is enough. I can get the values of text ...
Kota.M's user avatar
  • 423
3 votes
1 answer
434 views

Importing assets with Feed Me using Element Exporter data

When I export data using Craft's built-in Element Exporter, asset fields are exported with an element ID. This is the same as Category and Entry fields, for example. However, when mapping fields in ...
John Johnson's user avatar
1 vote
1 answer
75 views

Dynamic Asset Sub Folder Paths based on section and. if/else or turnery operators

How can I create dynamic paths for asset uploads? Basically I want my structure to be like so; company-name-slug company logo-1.jpg image-2.jpg products product-image-1.jpg services ...
Terry Upton's user avatar
  • 1,884
1 vote
1 answer
153 views

Feed Me - syncing asset fields

I'm migrating a Craft 2 site to Craft 3 via rebuild. I've copied the assets over to the new site and indexed the upload directory - that all went well. However, after doing this and working on other ...
CreateSean's user avatar
  • 1,963
1 vote
2 answers
118 views

Merging Assets Fields

I've got this working but it seems terribly verbose to do something, that in my opinion should be easier. Is there a better way to get the assets from 2 different fields, merge them and output them ...
CreateSean's user avatar
  • 1,963
1 vote
1 answer
176 views

Select Transform Feature with Asset Field

If you insert an image in a Rich Text field you get an option to apply a transform, but that is not true when using an Asset field to choose an image, which seems strange. Is there any way to ...
Roi Agneta's user avatar
  • 1,463
2 votes
2 answers
742 views

How to get second asset?

I have an entry with an asset field that has up to 3 assets in it. If I want to load just the second asset in my template code, what's the syntax for this? (can't find any references/examples)
Britchie's user avatar
  • 215
4 votes
1 answer
203 views

Asset dynamic subfolder for User Matrix

I need to set an asset field's dynamic subfolder path to the User ID. The field is within a matrix. The matrix a field in a User profile. Setting it to {currentUser.id}, {owner.author.id}, {object....
Adam Menczykowski's user avatar
1 vote
1 answer
241 views

How can I create a new asset source?

Now I have a "gallery image" field which allows users to upload multiple images, and some "single-upload image field" in matrix block. For "single-upload image field", I want to force users to ...
yu xia's user avatar
  • 397
1 vote
2 answers
508 views

How to use an asset as featured image in different entries

I have currently the problem, that I can't use the same asset in different entries as featured image. Craft Pro Version: 3.0.9 My setup is the following: Volumes: Local, Base URL: @web/uploads, ...
noxify's user avatar
  • 31
1 vote
1 answer
42 views

Not all assets copied over when copying an entry from admin panel

I have a site with multiple locales. I have some entries that will have some basic fields such as title, description, etc and also an asset field. The asset field is translatable so I could have an ...
Chris's user avatar
  • 167
1 vote
1 answer
2k views

Eager-Loading Assets in Matrix

I've been using this example to eager load images, stored in an Assets field which is located in a Matrix field. My query looks like this: {% set entries = craft.entries.section('project') .with(['...
Slebbo's user avatar
  • 87
2 votes
0 answers
45 views

Carry over asset field content to other locales

I have a site with English and French locales. One of the fields we have assigned to our entries is an asset field. Currently when an admin adds a new entry, all the English content will carry over ...
Chris's user avatar
  • 167
1 vote
1 answer
537 views

Asset Field: Select a folder instead of all images

Is there a way to pick a folder from an asset field? The goal is to render a dynamic gallery from an asset folder (which is on S3) instead of selecting all images inside a folder by hand. Use case: ...
D.Steinel's user avatar
  • 113
1 vote
1 answer
180 views

How to return asset from custom user field

In Craft 3, one of my 'User' fields is an assets type field with one selectable asset ('profilePicture'). I have routing setup to load my template when a url looks like: domain.com/person/firstname-...
Adam George's user avatar
1 vote
1 answer
30 views

which Sources of asset field are checked

I have an asset field (craft\fields\Asset), how do I figure out which Sources it can use? (Which of the Sources boxes are checked)? This is for Craft 3, and I'd like to do it in twig (I have the ...
Marion Newlevant's user avatar