aoe / imgix
Provides the Auto Responsive Images feature of imgix called imgix.fluid()
Installs: 733
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 24
Forks: 1
Open Issues: 0
Language:JavaScript
Type:typo3-cms-extension
Requires
- php: ^8.0
- ext-curl: *
- ext-json: *
- typo3/cms-backend: ^11.5
- typo3/cms-core: ^11.5
- typo3/cms-extbase: ^11.5
- typo3/cms-fluid: ^11.5
Requires (Dev)
- phpcompatibility/php-compatibility: ^9.3
- phpstan/phpstan: ^1.10
- rector/rector: ^1.0
- symplify/easy-coding-standard: ^12.1
- symplify/phpstan-rules: ^12.4
- typo3/testing-framework: ^7.0
- dev-main
- 11.2.0
- 11.1.2
- 11.1.1
- 11.1.0
- 11.0.9
- 11.0.8
- 11.0.7
- 11.0.6
- 11.0.5
- 11.0.4
- 11.0.3
- 11.0.2
- 11.0.1
- 11.0.0
- 8.3.3
- 8.3.2
- 8.3.1
- 8.3.0
- 8.2.1
- 8.2.0
- 8.1.0
- 8.0.1
- 8.0.0
- 3.0.1
- 3.0.0
- 2.0.1
- 2.0.0
- 1.6.0
- 1.5.1
- 1.5.0
- 1.4.0
- 1.3.0
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.1
- 1.0.0
- 0.3.0
- 0.2.0
- 0.1.0
- dev-TYPO3_8
- dev-Fix_UrlHandling_ExternalStorage
- dev-feature/codestyle_migration
This package is auto-updated.
Last update: 2024-11-27 07:01:37 UTC
README
The "imgix" TYPO3 extension provides the Auto Responsive Images feature of imgix called imgix.fluid(). This allows you to deliver perferctly custom sized images for the client without using local capaticities. For more details have a look at imgix, imgix.fluid() and the JS library imgix.js.
In addition this extension provides some additional features like:
- Supports different integrations (jQuery and AngularJS)
- Fallback scenario if you disable the fluid feature
- Observation of asynchronously added images
Missing/Upcoming features:
- Currently this extension is limited to images on which you have access to manipulate the way the image is outputted to the browser. The reason for that is that img tags must have a specific class set and a data-src attribute in which the image url is stored. In future releases we will implement this in TYPO3´s standard rendering.
- Version 3 of imgix.js is not supported yet
Download / Installation
composer require aoe/imgix
Documentation
Activate Extension
Once the "imgix" extension is installed you have to activate the extension in the TYPO3 "Extension Manager". You can do that by using the the TYPO3 Backend Module or using the comand line tool.
Configure Extension
Click the "configure" action button to open the configuration. You can also do that by clicking the extension title.
The configuration is seperated in two parts: "basic" and "imgix"
basic
The basic configuration includes specific settings of the extension which you need to set up for your project.
basic.apiKey
This is the apiKey you have specified in the imgix webapp. The API-key must be configured when you want to purge images in imgix. For further information have a look at the imigx doumentation.
basic.host
This is the host you have specified in the imgix webapp as source for your project. Be aware that you have to use the "Web Folder" source in imgix. For further information have a look at the imigx doumentation.
basic.enabled
If basic.enabeld is set to false, the JS will never be rendered into browser.
basic.enableFluid
Check this configuration if the image urls should be replaced by the configured basic.host configuration. If basic.enabeld is set to false, it will cause a fallback behavior: all image urls will be used as they are. This is helpful if you want to disable the responsive images from imgix using a simple checkbox without having broken or missing images.
basic.enableObservation
If your JS adds images dynamically/asynchroniously, this setting will observe these changes to the DOM and will add the responsive image feature to new HTML image tags. Be careful by enabling this option. This feature is realized by Mutation Observers which is not supported by all browsers at the moment.
imgix
The imigx configurations are imgix.js related settings. For a detailed description about the options, take a look at the documentation.
imgix.defaultUrlParameters
If some of the URL API Parameters should be set by default, list them here as a GET-Parameter string, e.g. q=75&fit=max
Include
To use this extension you have to add a static template file to your template record.
- "imgix: Common Constants (imgix)"
Now you have to take a decision for one of the supported integrations:
AngularJS
For AngularJS you have to add these two static template files to your template record:
- imgix: Load Angular Extbase-Plugin for further usage (imgix)
- imgix: Include Angular-Module files into page (imgix)
jQuery
For jQuery you have to add these two static template files to your template record:
- imgix: Load Jquery Extbase-Plugin for further usage (imgix)
- imgix: Include Jquery-Plugin files into page (imgix)
Usage
AngularJS Module
Add the module dependency
angular.module('your-module', ['aoe.imgixify']);
Use the "aoe-imgix" directive for images
<img aoe-imgix class="imgix-fluid" data-src="fileadmin/my-fancy-image.jpg">
jQuery Plugin
To use responsive images you have to add the following class and attribute to you HTML image tag:
- add the "image-fluid" class defined in fluidClass
- add the the data-src attribute.
<img class="imgix-fluid" data-src="fileadmin/my-fancy-image.jpg">
License
License: GPLv3 or later. See LICENSE.
Contributing
1. Fork the repository on Github
2. Create a named feature / bugfix branch (like `feature/add-something-new` or `bugfix/thing-which-does-not-work`)
3. Write your change
4. Write tests for your change (if applicable)
5. Run the tests, ensuring they all pass
6. Submit a Pull Request using Github