Created
July 6, 2021 06:17
-
-
Save kurozumi/840e8c54195b409734448a7d04e5f2c1 to your computer and use it in GitHub Desktop.
複数カテゴリ検索プラグインで特定のカテゴリで検索されたときのみ検索項目を表示させる方法
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if form.vars.value.category_ids|filter(c => c.id == 1)|length > 0 %} | |
{% set searchItem = repository("Plugin\\MultiCategorySearch4\\Entity\\SearchItem").find(1) %} | |
{% set value = 'search_item_' ~ searchItem.id %} | |
<dl> | |
<dd> | |
<div class="ec-blockCheckbox"> | |
<label class="ec-label">{{ searchItem.name }}</label> | |
{% for i, item in form[value] %} | |
{{ form_widget(item, {'id': value~'_'~i~'_side'}) }} | |
{% endfor %} | |
</div> | |
</dd> | |
</dl> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment