Qidiruv bo'lsa, sarlavhani chiqarmaslik: Grid ichida natijalar yo'q

Saytda resurslarni boshqarish va yuklab olish uchun Grid foydalanayapmiz. Segmentga asoslangan turli xil yozuvlardan resurslarni birlashtirish kerak. Tegishli resursni chiqarish uchun Grid-ni tanlang.

This is working as expected, but we cannot find a way to not output the

and
    if the search: within Grid has no results. If we use {limit="1"} on {exp:channel_entries} it won't work, as the entry it recalls may or may not have the appropriate resource in the Grid Select Dropdown.

    Har qanday yordam juda minnatdor bo'ladi, rahmat.

    Waste Management Group {segment_2}

      {exp:channel:entries channel="groups" disable="categories|member_data|pagination|trackbacks" dynamic="no" status="open" cache="yes" refresh="30" } {group_resources search:resource_type="{segment_2}"}
    • {group_resources:resource_title} {group_resources:resource_file}({exp:filesize_format dec="0"}{file_size}{/exp:filesize_format} {extension}){/group_resources:resource_file}
    • {/group_resources} {/exp:channel:entries}

1

1 javoblar

You can use conditionals in the Grid loop to conditionally output the heading and

    tags:

    {group_resources search:resource_type="{segment_2}"}
    {if group_resources:count == 1}
    

    Waste Management Group {segment_2}

    {/if} {/group_resources}
1
qo'shib qo'ydi
Sizga kerak bo'lgan narsalar, grid maydoni uchun shartli no_results hisoblanadi. Buning mavjudligiga ishonchim komil emas.
qo'shib qo'ydi muallif Daan, manba
Ther Jeremy. Bu esa, Griddagi kamida bitta qatorni o'z ichiga olgan har bir kirish uchun yana bir marta

va
    ni chiqaradi. Har bir chiqish uchun har bir
      ni yopadi.

qo'shib qo'ydi muallif Dzmitry Kashlach, manba
Ther Jeremy, men buni o'ylamayman. Assotsium yordamida sayt resurslari qismini qayta tiklashni yakunladim.
qo'shib qo'ydi muallif Dzmitry Kashlach, manba