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

[BUGFIX] Fix edge case with negative number of maxitems #122

Open
wants to merge 1 commit into
base: feature/show-maxitems-in-pagemodule
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
2 changes: 1 addition & 1 deletion Classes/ViewHelpers/MaxitemsViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static function renderStatic(
\Closure $renderChildrenClosure,
RenderingContextInterface $renderingContext
) {
$maxitems = -1;
$maxitems = -9999;

/** @var GridColumn $column */
$column = $arguments['column'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,22 @@
<f:alias map="{maxitems: '{cd:maxitems(column: column)}'}">
<div class="t3-cd-badge-container" data-maxitems="{maxitems}">
<f:switch expression="{maxitems}">
<f:case value="-1"></f:case>
<f:case value="-9999"></f:case>
<f:case value="1">
<span class="badge text-bg-warning t3-cd-badge">{maxitems}</span>
</f:case>
<f:case value="0">
<span class="badge text-bg-danger t3-cd-badge">{maxitems}</span>
</f:case>
<f:defaultCase>
<span class="badge text-bg-success t3-cd-badge">{maxitems}</span>
<f:if condition="{maxitems} < 0">
<f:then>
<span class="badge text-bg-danger t3-cd-badge">{maxitems}</span>
</f:then>
<f:else>
<span class="badge text-bg-success t3-cd-badge">{maxitems}</span>
</f:else>
</f:if>
</f:defaultCase>
</f:switch>
<f:render partial="PageLayout/Grid/ColumnHeader" arguments="{_all}" />
Expand Down