diff --git a/plugins/dynamiques-blocks/acf-blocks/random-collection-image/block.json b/plugins/dynamiques-blocks/acf-blocks/random-collection-image/block.json new file mode 100644 index 0000000..52499ea --- /dev/null +++ b/plugins/dynamiques-blocks/acf-blocks/random-collection-image/block.json @@ -0,0 +1,28 @@ +{ + "name": "acf/random-collection-image", + "title": "Random Collection Image", + "category": "Image aléatoire de collection", + "multiple": false, + "icon": { + "foreground": "#136f63", + "src": "groups" + }, + "keywords": [ + "image", + "aléatoire", + "collection" + ], + "supports": { + "align": [ + "full", + "wide" + ] + }, + "acf": { + "mode": "auto", + "renderTemplate": "random-collection-image.php" + }, + "align": [ + "wide" + ] +} \ No newline at end of file diff --git a/plugins/dynamiques-blocks/acf-blocks/random-collection-image/random-collection-image.php b/plugins/dynamiques-blocks/acf-blocks/random-collection-image/random-collection-image.php new file mode 100644 index 0000000..5790a8c --- /dev/null +++ b/plugins/dynamiques-blocks/acf-blocks/random-collection-image/random-collection-image.php @@ -0,0 +1,30 @@ + 1.2: + $random_image_ratio_class = 'random-collection-image--landscape'; + break; + case $random_image_ratio < 0.8: + $random_image_ratio_class = 'random-collection-image--portrait'; + break; + default: + $random_image_ratio_class = 'random-collection-image--square'; + break; +} +?> +
+ <?php echo $random_image['alt']; ?> + +
+ +
+ +
\ No newline at end of file