Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scaleflex/spryker-cloudimage-plugin
https://github.com/scaleflex/spryker-cloudimage-plugin
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/scaleflex/spryker-cloudimage-plugin
- Owner: scaleflex
- License: other
- Created: 2022-08-11T11:26:58.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-16T04:25:44.000Z (2 months ago)
- Last Synced: 2024-09-17T05:05:56.190Z (2 months ago)
- Language: PHP
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Cloudimage
### Installation
Start up the Spryker shop and run:
~~~
composer require scaleflex/spryker-cloudimage
~~~### Configuration in the shop
To get the package running, register the "Scaleflex" namespace into the config_default.php in the KernelConstants::CORE_NAMESPACES
~~~
$config[KernelConstants::CORE_NAMESPACES] = [
'Scaleflex',
...
];
~~~
Set these constants in the config, where it is needed. the BaseUrl and the ignoredUrlPaths need to be set according to the use case.
~~~
use Scaleflex\Shared\Cloudimage\CloudimageConstants;$config[CloudimageConstants::TOKEN] = '{{YOUR_TOKEN}}';
$config[CloudimageConstants::BASE_URL] = 'http://yves.de.spryker.local';
$config[CloudimageConstants::IGNORED_URL_PATHS] = ['http://yves.de.spryker.local'];
~~~### Integration into the code
Register the Twig plugin in the Pyz\Yves\Twig\TwigDependencyProvider.php
~~~
/**
* @return \Spryker\Shared\TwigExtension\Dependency\Plugin\TwigPluginInterface[]
*/
protected function getTwigPlugins(): array
{
return [
...
new CloudimageTwigPlugin(),
];
]
~~~#### Example
Use the TwigFilter for the images. Here is an example of how to extend the Pyz\Yves\ShopUi\Theme\default\components\molecules\lazy-image.twig.
Everywhere this molecule will use Cloudimage and apply a grey filter.
~~~
{% block body %}
{% set data = data | merge({'imageSrc': data.imageSrc | cloudimage({}, {grey: 1}) }) %}
...
{% endblock %}
~~~#### How to use the plugin
~~~
cloudimage({YOUR_OPERATIONS}, {YOUR_FILTERS})
~~~
Cloudimage documentation for the operations:
https://docs.cloudimage.io/go/cloudimage-documentation-v7/en/image-resizingCloudimage documentation for the filters:
https://docs.cloudimage.io/go/cloudimage-documentation-v7/en/image-filters