Closed spAnser closed 4 years ago
Hi! I tested it right now and it's working as expected. The images will be published on request. Did you copy the images in the same subdirectory structure as required in the config file? They have to be in @config/buttons/images.
Yes and I couldn't get them to show up. By changing the false to true everything started working for me.
According to the craft documentation if you have the second argument as false it wont publish files. https://docs.craftcms.com/api/v3/craft-web-assetmanager.html#public-methods
If you already have the files in cpresources then it will work fine. But with new images that don't exist in cpresources it wont copy them over.
Hmm, I verified this. Yes, you are right, with "true" as second parameter, the files will be written down to the disc in the directory cpresources. In our installation, the request is passed to index.php, when the files are not found. So craft is sending the images (fall back way). And that's based on the hash used in the path and the corresponding entry in the db table "resourcepaths". So yes, we will change this to true, but it should work also in the other way.
I just released 1.0.1 fixing this. Please test it.
The example: https://github.com/codemonauts/craft-customizable-radio-buttons-field/blob/master/examples/positions/buttons.php
The images don't show up because they are not being published because getPublishedUrl second argument is false:
https://github.com/codemonauts/craft-customizable-radio-buttons-field/blob/5a1f87c19c2874142ab4abc905ff602aacc06fe7/src/fields/Buttons.php#L89