Open richardhj opened 8 years ago
Sort and limit should be visible when defined, in fact I do not know of any way to hide them. First off, have you tried cleaning the MetaModels cache? If so, we need more information to pinpoint this as we have virtually no knowledge of your system. Can you give us with an excerpt of the generated HTML of the panel section? Furthermore, what Version of Contao, MetaModels, DcGeneral etc. are you running?
I purged the MetaModels cache and keep MetaModels (2.0.0), Contao (3.5.8) and DCG to the latest versions. The sort and limit should be configured properly, I tested it by switching to a non-variant-metamodels. (Furthermore I know how to define the filters but don't know how to define the limit). This is the panel's html markup:
<form action="contao/main.php?do=metamodel_mm_xxx&ref=bcda8dc8" class="tl_form dc_general_panel" method="post">
<div class="tl_formbody">
<input type="hidden" name="FORM_SUBMIT" value="tl_filters">
<input type="hidden" name="REQUEST_TOKEN" value="21e11cfd46638e83ef869d73a92ab0de">
<div class="tl_panel">
<div class="tl_search tl_subpanel even first last">
<strong>Suchen:</strong>
<select name="tl_field" class="tl_select">
<option value="name">Titel</option>
</select>
<span> = </span>
<input type="text" name="tl_value" class="tl_select" value="">
</div>
<div class="clear"></div>
</div>
<div class="tl_panel">
<div class="tl_submit_panel tl_subpanel even first">
<input type="image" name="filter" id="filter" src="system/themes/default/images/reload.gif" class="tl_img_submit"
title="Anwenden"
alt="Anwenden">
</div>
<div class="tl_filter tl_subpanel odd last">
<strong>Filtern:</strong>
<select name="host" id="host" class="tl_select">
<option value="tl_host">Veranstalter</option>
<option value="tl_host">---</option>
<option value="" selected></option>
</select>
</div>
<div class="clear"></div>
</div>
</div>
</form>
OK, finally found the cause: https://github.com/contao-community-alliance/dc-general/blob/master/src/ContaoCommunityAlliance/DcGeneral/Contao/View/Contao2BackendView/TreeView.php#L532 I commented both (LimitElementInterface and SortElementInterface) and they are shown in the tree view. The sort does not influence the tree view although defined correctly in the MetaModel - but it's ok for me. The limit works at first sight. The limit setting "all" does not work properly, the setting jumps back to "0,30" (which is default). I can reproduce this flaw in a completely different MetaModels which does not handle variants too. EDIT: the setting jumps back to "0,30" but all items are shown correctly.
EDIT: the setting jumps back to "0,30" but all items are shown correctly.
@richardhj its possible to test with the current versions of DCG and MM - the "jumps back to '0,30' - Bug" is fixed...
Why are "limit" and "sort" in the ignored panels? (see https://github.com/contao-community-alliance/dc-general/blob/hotfix/beta-39/src/ContaoCommunityAlliance/DcGeneral/Contao/View/Contao2BackendView/TreeView.php#L531-L534) I have had to comment the line but limit panel works fine ✌️
Because they were/are not working properly in tree views.
Because they were/are not working properly in tree views.
@discordier => bug or feature?
For sure it is a bug. But it is a tiny bug. The limit works properly and it's just the count in the select widget, that's wrong. In the select widget, the count includes the variants, although the limit works properly in 30-steps excluding variants. I also looked in the code of the DCG already, it might be fixed easily (if I would know the DCG a little better :D)
@discordier & @richardhj we´d change to milestone 2.x ?
I created a MetaModel with variants. The panel layout is
search,sort;filter,limit
. In the list view,sort
andlimit
are not shown. The main problem is that there is a cut-off of 30 items. There is no possibility to see items behind this cut-off.