3

Try using {site.handle} instead of {{currentSite.handle}} and it should work ok.


3

I'm guessing you may have found an answer to this, but have you seen the download assets plugin? It puts a download button next to every asset on an edit page that links to the asset's url.


2

Thanks for the assist. Just updated my Craft and all sorted.


2

Ok, think I know what's wrong – you want to select the first asset, but not its url. E.g. {{ svg(callout.icon.one()) }}


2

Assuming you are on a front end entry form editing an entry, there are a few steps to this. First get all assets a user can choose from: {% set allImages = myAssetQuery.all() %} Next, get the ids of already chosen assets: {% set alreadyChosenImages = entry.businessStandardImages.ids() %} Loop over all images, check the ones already selected: {% for image ...


2

In Craft 3 this should be: {% if entry.images | length > 1 %} {% set secondImage = entry.images.1 %} {% endif %}


1

So, I found the problem / solution myself: I have 2 file volumes in my Craft installation (documents, images) The asset field I am trying to fill via FeedMe is in its configuration limited to the "images" file volume, but the default location for uploads is (erroneously) configured in the documents share. In this case, FeedMe is determining the ...


1

Finally found the answer after much time spent on it. The $(this).serialize() loses the file input - and can't submit. Updated ajax submit to $.ajax({ type: 'POST', url: url, data: new FormData(this) , dataType : 'json', // changing data type to json processData: false, contentType: false, success: function (response) { // ...


1

For a field outside the Matrix, you can use {username} and for the one in the Matrix, use {owner.username} - see docs You might need to run Utilities → Asset Indexes.


1

If I understand the question properly, this should do it for you: {% if entry.gallery|length %} <div class="main-carousel"> {% for image in entry.gallery.all() %} <div class="carousel-cell"> <img src="{{ image.url }}" alt="{{ image.title }}" /> </div> {% endfor %} </div> {% endif %}


1

I have solved it by myself. $asset = $user->getFieldValue(FIELDHANDLE)->one(); $user->setFieldValues([ 'FIELDHANDLE' => $asset->filename ]);


1

I don't know if you're still facing this issue but it's something I'm working on right now! Basically my solution was to create a short program to parse through the Element Exporter json and to change anything that was an Asset ID to that asset's url (which Feed Me accepts). public function modifyExport(array $element): array { $result = []; ...


1

So this was a simple fix and not to use {% %} tags but instead to use {{ }} tags. Changing the above logic in the subdirectories filed like so seems to have resolved the issue. {{ section == 'Company' ? slug : company.one|kebab }}/{section|kebab}


Only top voted, non community-wiki answers of a minimum length are eligible