Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add classes for plugin type #1457

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Classes/ViewHelpers/FrameViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
$this->registerArgument('frameClass', 'string', '', false, 'default');
$this->registerArgument('frameAttributes', 'array', 'Additional tag attributes. They will be added directly to the resulting HTML tag.', false, []);
$this->registerArgument('type', 'string', '', false, 'default');
$this->registerArgument('listType', 'string', 'Type of plugin');
$this->registerArgument('size', 'string', '', false, 'default');
$this->registerArgument('height', 'string', '', false, 'default');
$this->registerArgument('layout', 'string', '', false, 'default');
Expand All @@ -72,6 +73,7 @@
) {
$configuration = $arguments;
$configuration['type'] = trim((string) $configuration['type']) !== '' ? trim($configuration['type']) : 'default';
$configuration['listType'] = trim((string) $configuration['listType']);
$configuration['frameClass'] = trim((string) $configuration['frameClass']) !== '' ? trim($configuration['frameClass']) : 'default';
$configuration['frameAttributes'] = isset($configuration['frameAttributes']) && is_array($configuration['frameAttributes']) ? $configuration['frameAttributes'] : [];
$configuration['size'] = trim((string) $configuration['size']) !== '' ? trim($configuration['size']) : 'default';
Expand All @@ -89,6 +91,9 @@
$classes[] = 'frame';
$classes[] = 'frame-' . $configuration['frameClass'];
$classes[] = 'frame-type-' . $configuration['type'];
if ($configuration['listType']) {

Check failure on line 94 in Classes/ViewHelpers/FrameViewHelper.php

View workflow job for this annotation

GitHub Actions / Build PHP (^12, 8.1, 8.0)

Only booleans are allowed in an if condition, string given.

Check failure on line 94 in Classes/ViewHelpers/FrameViewHelper.php

View workflow job for this annotation

GitHub Actions / Build PHP (^12, 8.2, 8.0)

Only booleans are allowed in an if condition, string given.
$classes[] = 'frame-type-list-' . $configuration['listType'];
}
$classes[] = 'frame-layout-' . $configuration['layout'];
$classes[] = 'frame-size-' . $configuration['size'];
$classes[] = 'frame-height-' . $configuration['height'];
Expand Down
1 change: 1 addition & 0 deletions Resources/Private/Layouts/ContentElements/Default.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<bk2k:frame
id="c{data.uid}"
type="{data.CType}"
listType="{f:if(condition: '{data.CType} == \"list\"', then: data.list_type)}"
size="default"
layout="{data.frame_layout}"
frameClass="{data.frame_class}"
Expand Down
Loading