Questions tagged [assets]
Files managed by Craft, stored in physical folders or (with Craft Pro) on Amazon S3, Rackspace Cloud, and Google Cloud.
783
questions
1
vote
1answer
1k views
Asset URL's return nothing in Craft 3
I have an Assets field assigned to my homepage. I can assign and upload images the same way I've always done.
When it comes to templating, I can loop through the images and output the filename. What ...
1
vote
2answers
178 views
Homepage showing up as “index of \” page
I am uploading a repo that works fine on a staging server to a live server. When doing so however the homepage is showing as "index of \" page with the public and readme.md directories showing. Like ...
1
vote
1answer
106 views
What's the purpose of multiple asset sources?
If I have just one S3 bucket, should I still have multiple asset 'sources' in order to account for different asset types? Or should I just have multiple folders under single asset source to ...
1
vote
0answers
32 views
_entry.twig in sub folder, rich text editor images using relative URL and are therefore not found
This may be something obvious that I'm missing, but how can I make craft use absolute URLs for images add to rich text editor fields? Or use the {{siteUrl}} prior to the image src URL in order to fix ...
1
vote
1answer
282 views
Store form data with file upload in an asset source using Freeform
I currently have a form that has an upload file fieldtype and this currently stores the file in an asset source in Craft. What I would like to do is attach some of the form submitted field data ...
0
votes
1answer
146 views
Rename assets to lowercase
As there is no native config to control the naming of assets I am trying to write a small plugin to do this.
Here is what I have;
craft()->on('assets.saveAsset', function (Event $event) {
...
1
vote
2answers
72 views
Cannot see local or s3 image asset source
I have the correct image asset source for S3 and also a local folder. Neither folder contents show (they were previously) and I see an "unknown error occurred" popup. I've tried turning off image ...
1
vote
1answer
40 views
Replacement for deprecated AssetsService
Im developing my first plugin and was interested in using the findFolder() method from AssetsService but i noticed the class is depreciated. What is the proper way of achieiving the functionality of ...
3
votes
1answer
525 views
Fetch/Remove all unused assets (by plugin)
The title is self-explanatory, but I need to buid a service function to remove unused assets, or at least to fetch those in order to delete found assets after.
Any simple solution?
2
votes
1answer
443 views
Rotate image according to EXIF orientation not working from a plugin
I am using a front-end form to upload images and store them as assets on an amazon S3 bucket.
My server has imagick installed an uses it and in my config I have "rotateImagesOnUploadByExifData" set ...
3
votes
2answers
76 views
Use Imager plugin with AssetTransforms defined in admin panel
I'm trying to use the Imager plugin with some asset transforms that I've defined in the admin panel. Passing the name of the transform is just tossing an error at me. Is there a way to do this, or ...
1
vote
1answer
54 views
Trying to set a default asset folder using Craft tags
I'm trying to set a default asset folder for a field, as per the Craft docs on Dynamic Subfolder Paths.
I'm trying to set the asset path for each blog article to be /our-journal/{date}/{slug}, where ...
1
vote
2answers
66 views
Error when outputting assets from a field within a Neo field
Anyone with Neo experience had issues with outputting an assets field with multiple images?
I am not using a dynamic field, as I saw there are issues with that.
Code
{% for asset in block....
0
votes
0answers
315 views
Uploading Assets - Problems
I've got a number of assets directories set up. One of them is having an issue where if you upload an image it doesn't appear in the control panel despite having been uploaded to the server. I checked ...
3
votes
1answer
562 views
How to find out which assets are being used
I want to be able to delete assets that are not linked to. I have adapted the following code from previous examples of this kind of thing, but it doesn't seem to pick up all the related entries, just ...
1
vote
2answers
493 views
How can I base64-encode an Image Transform?
I'm trying to use this plugin, but it requires an AssetFileModel as input. I can pass it the asset in question, no problem, but I'm wanting to pass it a transformed version of the asset. However, it ...
1
vote
1answer
70 views
Assets have old URL
I've just changed my local development environment from using .local domains to .localhost (no more DNS trouble on MacOS, yay!).
So I set Crafts siteUrl to .localhost, and while Craft serves pages ...
2
votes
0answers
113 views
“Missing” assets from large S3 asset source
We have an S3 asset source with ~33k images. In the admin, quite a few arenāt completely loaded (see image below). Users are able to add these to entries but they donāt display on the front end. ...
1
vote
1answer
36 views
Customise the URL for an asset
I need to prepend a URL to the beginning of an asset URL in order to track stats for a podcast via Blubrry.
What are the options?
Specifically I need to drop the https that would appear in my URL by ...
3
votes
1answer
137 views
How can I safely identify a single asset-folder?
Background
I'm writing a plugin that will function as a document-archive with access-rights to different folders set based on user-groups.
In addition to folders which are restricted, there is also ...
0
votes
2answers
81 views
Image does not be shown
Good mornig
I am having a problem with my bannerImage.
First off i show you how i did it and what the problem is.
In the first picture you can see, how i get the image.
This method works fine for 3 ...
1
vote
1answer
42 views
Grabbing an asset field from Page A to display on Page B
I'm trying to display an asset that the client has selected to show up on the main page, and have it display on a totally different page. This sounds simple but I keep getting errors (and im learning)....
1
vote
0answers
180 views
What's the best way to move a lot of assets from local to S3 and keep relations [duplicate]
My client has a catalogue website with a big amount of assets. What's the best way to move the assets from local to Amazon S3?
1
vote
1answer
217 views
renaming a file in onBeforeSaveAsset won't work
I'm trying to rename a file before it is actually saved into Craft, by using the following code snippet in a plugin:
craft()->on('assets.onBeforeSaveAsset', function(Event $event) {
if($...
1
vote
1answer
327 views
Dynamic Subfolder Paths - folder does not exist even after updating asset directories in settings
I have an asset directory which is set to
{basePath}assets/images/products/
I know my basePath is right as it works on other asset sources.
My entry upload location for products is set to:
{slug}/...
1
vote
2answers
504 views
How to store S3 credentials in environment variables?
For a Craft 2 S3 asset source, access keys are expected to be entered in from the Control Panel. Is there a way to supply the access key and secret through environment variables instead?
1
vote
1answer
401 views
Checking for duplicates in array
I'm trying to remove duplicate image objects from an array, but can't figure out why it won't find it:
{% for image in product.productGallery %}
{% set productGalleryArray = productGalleryArray|...
0
votes
1answer
184 views
Having an issue with assets, while i am upload the image from the admin
When i have upload the image using below settings that will give me an error The error message was: "Error uploading the file: The file system path "/public_html/src/assets/images/" set for this ...
1
vote
2answers
413 views
Clearing temporary assets from craft/storage/runtime
After some unsuccessful uploads I ended up with a lot of loose files in craft/storage/runtime/assets/tempuploads
They show up in the asset list when selecting assets for new entry. How do I remove ...
2
votes
1answer
588 views
8MB memory limit on asset uploads?
I'm trying to upload a 40MB video through the assets tab in the admin panel, but I get an error saying "The file "x.mp4" could not be uploaded, because it exceeds the maximum upload size of 8.0 MB."
...
2
votes
2answers
2k views
Setting absolute path to asset files for Craft 3 multisite
Currently, I have 3 sites set up in Craft 3 beta. I'm trying to get all my sites to share one asset folder by using absolute path. However, I can't seem to set it up. The siteUrl is not parsing as I ...
1
vote
0answers
269 views
For asset uploads, where should the 'temporary path" be created?
I just moved my Craft CMS site to production (MediaTemple DV) and I can't upload images to my asset sources. I get this error:
Error uploading the file: there was a problem creating the temporary ...
1
vote
0answers
111 views
Front end asset uploads not correctly rotated
Running into an issue whereby front end asset uploads are not the correct orientation. I've spotted this mostly with user profile pics.
What's the best way to start debugging this?
My server has ...
3
votes
1answer
2k views
Craft 3: Environment variables are not parsed when used in Assets source field
I'm using Craft 3 and I have 2 Sites setup.
In my config/general.php file I have:
return [
'*' => [
'environmentVariables' => [
'baseAssetsUrl' => '//'.strtolower($...
0
votes
1answer
85 views
How to display all fields for an entry within an entry field type?
I've got a portfolio site I'm building, and on each project's page I'm wanting to show a list of people who worked that project. I created a channel section called "work" with an entry field type ...
0
votes
1answer
490 views
Update Asset Indexes for new files in s3 not working
We uploaded a lot of images to the S3 bucket that is connected to our assets in Craft, but when we run "Update Asset Indexes" on the settings page, those images aren't added to the assets in Craft.
I'...
1
vote
1answer
364 views
Local vs Amazon S3 asset paths in multi-environment config
I'm looking to pull assets from a local folder when developing locally, and an S3 folder when on staging/production.
Is this possible? It looks like no, but I'm hoping that's not the definitive ...
2
votes
2answers
593 views
Assets on localhost
I'm running Craft with MAMP under this file system path:
craft/
public_html/
index.php
img/uploads/
Via Settings > Assets, I have set the following paths:
I've also tried this path under "...
1
vote
1answer
379 views
How to display a specific image from Assets field
I have an Assets field with a set of images. What is the best way to find one image that has 'featured' checkbox checked? This is the code I put together to check which of the images is marked '...
2
votes
0answers
423 views
Can't find assets publicly via URL
Basically, I have an asset volume called Images, with
base URL: /photos/
file system path: ~media/images
Then I go to upload the asset and I try to view it, it gives me a 404 "Template not Found"
...
1
vote
1answer
1k views
Craft asset urls not working
I have checked all other questions on stack exchange with similar titles and they don't seem to help my situation.
I have added assets sources to craft CMS. but when uploading I get the following ...
1
vote
1answer
79 views
asset.getUrl() not correct: missing subfolder directory
I created a new asset source/folder called "my-assets".
It has an entry in the DB in "craft_assetsources" with the id=10, path="my_base_folder/assets/my-assets/" and url="/assets/my-assets/",
plus ...
2
votes
1answer
376 views
Dynamic upload location for Super Table within a Matrix field?
I'm trying to set dynamic upload locations for my asset fields that are in a Super Table field within a Matrix field. So it's Matrix > Super Table > Asset field. I'm getting the following error when I ...
1
vote
1answer
519 views
Problem uploading JPG in MAMP Pro 4.2 (9213)
I use MAMP Pro for a few years in combination with Craft CMS, but since the new upgrade to version 4 I cannot upload JPGs anymore. Dit anybody had the same issue and how to fix this?
In the PHP7.0.20....
2
votes
1answer
35 views
Overcoming Rackspace Cloud Files 10,000 object limit
Original question from Craft Slack:
Is there anyway to hack the AssetIndexTool to start at a certain asset/position/filename/index?
Weāre using Rackspace Cloud Files and have around 25k images ...
1
vote
1answer
219 views
Assets are not saved in dynamically generated folders
I setup an Assets field called Images. My Default Upload Location is set as {parent.uri}/{slug}
My File System Path for that folder is img/
The directory structure that is generated is correct and ...
0
votes
1answer
354 views
404 Error on Image Transforms
Transformed Images are failing to load with a 404 error For example:
http://mysite.com/index.php?p=cpresources/transforms/382&x=v0nGRK3Qr
This happened after I swapped the db. So, everything ...
3
votes
1answer
2k views
Object of class Craft\ElementCriteriaModel could not be converted to string
I have set up a Matrix field that contains a block type that contains among other things, an asset field.
Trying to iterate through the contents of that matrix field works just fine for all other ...
1
vote
1answer
366 views
How do I get the full path of an asset? [duplicate]
I've written a simple plugin that attaches to the onSaveEntry event. I'd like to access the image, extract the colours from the image using https://github.com/brianmcdo/ImagePalette and then save ...
0
votes
1answer
42 views
Why are there now blank entry folders in my image assets folder?
There are folders in my images asset folder craft/public_html/images/ named for individual entries (posts). But, the folders are empty. This is something new. Only recent posts are represented. ...