From 88f1bd6d75deb9b07debb73185b1df98ab132f53 Mon Sep 17 00:00:00 2001 From: Niclas Norin Date: Fri, 8 Sep 2023 13:58:01 +0200 Subject: [PATCH] Feat: Placeholder image added the correct way --- source/php/Component/Card/Card.php | 2 +- source/php/Component/Segment/Segment.php | 4 ++++ source/php/Component/Segment/segment.json | 8 +++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/source/php/Component/Card/Card.php b/source/php/Component/Card/Card.php index 040b2645..7015b6ef 100644 --- a/source/php/Component/Card/Card.php +++ b/source/php/Component/Card/Card.php @@ -63,7 +63,7 @@ public function init() $this->data['displayIcon'] = true; } - if ($hasPlaceholder) { + if (!empty($hasPlaceholder)) { $this->data['classList'][] = $this->getBaseClass() . '--svg-background'; } diff --git a/source/php/Component/Segment/Segment.php b/source/php/Component/Segment/Segment.php index 11fe30d2..d43a1889 100644 --- a/source/php/Component/Segment/Segment.php +++ b/source/php/Component/Segment/Segment.php @@ -36,6 +36,10 @@ public function init() $this->data['link'] = $buttons[0]['href']; } + if (!empty($hasPlaceholderImage)) { + $this->data['classList'][] = $this->getBaseClass('svg-background', true); + } + $this->data['imageClassList'] = []; if ($this->data['content'] == strip_tags($this->data['content'], [])) { diff --git a/source/php/Component/Segment/segment.json b/source/php/Component/Segment/segment.json index 0f6f621d..b210519e 100755 --- a/source/php/Component/Segment/segment.json +++ b/source/php/Component/Segment/segment.json @@ -7,7 +7,7 @@ "textSize": "default", "image": false, "imageFocus": { - "top": 30, + "top": 50, "left": 50 }, "background": false, @@ -25,7 +25,8 @@ "meta": false, "tags": false, "icon": false, - "link": false + "link": false, + "hasPlaceholderImage": false }, "description": { "layout": "Which layout to use", @@ -49,7 +50,8 @@ "date": "The date", "tags": "Array of tags according to the tags component", "meta": "The meta text", - "icon": "An array with the same specification as the icon component" + "icon": "An array with the same specification as the icon component", + "hasPlaceholderImage": "Sets image specific styling based on the image being a placholder image." }, "view": "segment.blade.php", "dependency": {