|
1 | 1 | # Configuration
|
2 | 2 |
|
3 |
| -All of the available configuration: |
| 3 | +The bundle includes default configuration for basic usage and getting started. |
| 4 | +The system needs two filesystems configured to function, see [generated crud](filesystems.md) for details. |
| 5 | + |
| 6 | +A sample File system configuration: |
| 7 | + |
| 8 | +```yml |
| 9 | +oneup_flysystem: |
| 10 | + adapters: |
| 11 | + images.local: |
| 12 | + local: |
| 13 | + directory: '%kernel.root_dir%/../web/%responsive_image.image_directory%' # %kernel.root_dir%/cache/ |
| 14 | + images.temp: |
| 15 | + local: |
| 16 | + directory: '%kernel.root_dir%/../var/cache/resp_img' |
| 17 | + images.aws: |
| 18 | + awss3v3: |
| 19 | + client: images.s3_client |
| 20 | + bucket: 'your_bucket' |
| 21 | + prefix: 'oneup' |
| 22 | + options: { visibility: 'public-read', protocol: 'https' } |
| 23 | + filesystems: |
| 24 | + images.local: |
| 25 | + adapter: images.local |
| 26 | + alias: responsive_image_filesystem |
| 27 | + images.temp: |
| 28 | + adapter: images.temp |
| 29 | + alias: responsive_image_temp |
| 30 | + images.aws: |
| 31 | + adapter: images.aws |
| 32 | + |
| 33 | +``` |
| 34 | +Sample configuration for the bundle: |
4 | 35 |
|
5 | 36 | ```
|
| 37 | +# |
| 38 | +# This is the default configuration for this bundle. |
| 39 | +# |
6 | 40 | responsive_image:
|
7 |
| - debug: FALSE # If true debug info is printed on generated images |
8 |
| - image_compression: 80 # The compression quality of the generated images |
9 |
| - image_directory: 'uploads/images' # '%uploads_directory%' # The directory where uploaded images are saved |
10 |
| - image_styles_directory: 'styles' # The directory within the uploads directory where generated images are saved |
11 |
| - image_entity_class: 'ResponsiveImageBundle\Entity\ResponsiveImage' # The image entity |
12 |
| - image_driver: gd # The php image library |
13 |
| - breakpoints: # Breakpoint definitions |
14 |
| - base: 'min-width: 0px' |
15 |
| - mobile: 'min-width: 300px' |
16 |
| - tablet: 'min-width: 480px' |
17 |
| - phablet: 'min-width: 768px' |
18 |
| - desktop: 'min-width: 1100px' |
19 |
| - tv: 'min-width: 1800px' |
20 |
| - image_styles: # Image style definitions |
21 |
| - full: # Style name |
22 |
| - effect: scale # Style effect (scale or crop) |
23 |
| - height: 200 |
| 41 | + cache_bust: true |
| 42 | + image_compression: 90 |
| 43 | + # image_entity_class: 'AppBundle\Entity\ResponsiveImage' |
| 44 | + image_directory: 'test/images' |
| 45 | + image_driver: 'gd' |
| 46 | + image_styles_directory: 'styles' |
| 47 | + crop_focus_widget: |
| 48 | + include_js_css: TRUE |
| 49 | + display_coordinates: TRUE |
| 50 | +# Breakpoints |
| 51 | + breakpoints: |
| 52 | + base: |
| 53 | + media_query: 'min-width: 0px' |
| 54 | + desktop: |
| 55 | + media_query: 'min-width: 1100px' |
| 56 | + tv: |
| 57 | + media_query: 'min-width: 1800px' |
| 58 | + size_mq: |
| 59 | + media_query: 'min-width: 36em' |
| 60 | +# Image styles |
| 61 | + image_styles: |
24 | 62 | thumb:
|
25 |
| - effect: crop |
| 63 | + effect: 'crop' |
26 | 64 | width: 180
|
27 | 65 | height: 180
|
28 |
| - project_full: |
29 |
| - effect: scale |
30 |
| - width: 940 |
31 |
| - project_thumb: |
32 |
| - effect: crop |
33 |
| - width: 540 |
34 |
| - height: 400 |
35 |
| - picture_sets: # Picture set definitions |
| 66 | + thumb_2x: |
| 67 | + effect: 'crop' |
| 68 | + width: 360 |
| 69 | + height: 360 |
| 70 | + picture_thumb_base: |
| 71 | + effect: 'crop' |
| 72 | + width: 300 |
| 73 | + height: 600 |
| 74 | + picture_thumb_tv: |
| 75 | + effect: 'scale' |
| 76 | + width: 800 |
| 77 | + height: 600 |
| 78 | + greyscale: true |
| 79 | +# Sizesets |
| 80 | + size_sets: |
| 81 | + blog_sizes: |
| 82 | + fallback: 'thumb' |
| 83 | + sizes: |
| 84 | + 10vw: |
| 85 | + breakpoint: 'size_mq' |
| 86 | + srcsets: [ 'thumb', 'picture_thumb_base', 'picture_thumb_tv' ] |
| 87 | +# Picture sets |
| 88 | + picture_sets: |
36 | 89 | thumb_picture:
|
37 |
| - base: # Breakpoint name |
38 |
| - effect: crop # Style effect |
39 |
| - width: 300 |
40 |
| - height: 600 |
41 |
| - mobile: |
42 |
| - effect: crop |
43 |
| - width: 480 |
44 |
| - height: 300 |
45 |
| - tablet: |
46 |
| - effect: crop |
47 |
| - width: 400 |
48 |
| - height: 700 |
49 |
| - phablet: |
50 |
| - effect: crop |
51 |
| - width: 180 |
52 |
| - height: 380 |
53 |
| - desktop: thumb # To use a pre-defined style just use its name |
54 |
| - tv: |
55 |
| - effect: crop |
56 |
| - width: 300 |
57 |
| - height: 500 |
58 |
| - crop_focus_widget: # Crop focus widget settings |
59 |
| - include_js_css: TRUE # If true widget js css is included in the field html. Otherwise add it manually. |
60 |
| - display_coordinates: TRUE # Toggles between a text field or hidden field. |
61 |
| - aws_s3: |
62 |
| - enabled: FALSE |
63 |
| - remote_file_policy: STYLED_ONLY # STYLED_ONLY, ALL |
64 |
| - temp_directory: 'tmp/' # will be created within the symfony directory |
65 |
| - protocol: 'http' |
66 |
| - bucket: 'bucket_name' |
67 |
| - region: 'eu-west-1' |
68 |
| - version: 'latest' |
69 |
| - directory: 'directory_name' |
70 |
| - access_key_id: KEY_ID |
71 |
| - secret_access_key: ACCESS_SECRET |
| 90 | + fallback: 'thumb' |
| 91 | + sources: |
| 92 | + base: 'picture_thumb_base' |
| 93 | + desktop: 'thumb' |
| 94 | + tv: 'picture_thumb_tv' |
| 95 | + blog_picture: |
| 96 | + fallback: 'thumb' |
| 97 | + sources: |
| 98 | + base: 'picture_thumb_base' |
| 99 | + desktop: 'thumb' |
| 100 | + tv: 'picture_thumb_tv' |
72 | 101 | ```
|
0 commit comments