Hot answers tagged

4

You can define whatever aliases/environment variables you like. In this case, I'd probably define an environment variable in my .env file like this: BASE_WEB=http://example.com And then in config/general.php I'd add an alias: <?php /** * General Configuration * * All of your system's general configuration settings go in here. You can see a * list ...


2

You could run a query to fetch the folderId you need based on the name: {# Change this to your volumeId #} {% set volumeId = yourVolumeId %} {# Change this to your folderName #} {% set folderName = yourFolderName %} {# Returns an ID if there is a match, otherwise false #} {% set folderId = craft .query() .select(['id']) .from('{{%volumefolders}...


1

This turned out to be a Craft bug. I’ve posted an issue for it at https://github.com/craftcms/cms/issues/5849, and fixed it for the next release (3.4.12).


1

Author of the ImageOptimize plugin... when you say no luck with that either, what is going wrong? Once you install ImageOptimize, and add an Optimized Images field type to your asset volumes, it will create all of those responsive image transform for you. Check out the Using the Optimized Images Field section of the documentation. It can't just create all ...


1

Turned out to be a minor bug in 3.3.0.1. Fixed now.


1

See Asset::getImageTransformSourcePath() for how Craft CMS resolves the real local path. (https://github.com/craftcms/cms/blob/develop/src/elements/Asset.php#L1200) Should look something like this: $volume = $this->getVolume(); $assetFilePath = $volume instanceof LocalVolumeInterface ? FileHelper::normalizePath($volume->getRootPath() . ...


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