0

What am I doing wrong? What I try to reach is getting all entries that DO contain a grid-row. video is name of grid field, fragment is name of the column.

{exp:channel:entries channel="news" dynamic="no" search:video:fragment="not IS_EMTPY"}

    [here-content]

{/exp:channel:entries}

Thanks in advance.

0

I believe the grid fields aren't searchable with search= however you can search in the grid tag itself

{video search:fragment="not IS_EMPTY"}
    fields
{/video}
0

Well if you want to search into Grid then first you should enable all fields which you want to search, by Include in search? parameter from the Grid fieldtype. After that you should add search:column_name= with your grid field_name into your code.

In your case you should try with below code.

{video search:column_name="not IS_EMPTY"}
    {!-- your code --}
{/video}

I hope this will works for you.

  • Thanks Jelle and Harsh for the suggested solution. I created a work-around with a custom counter to limit to max 4 entries. This is because I only want to show the latest 4 video's of entries that do contain a video. So if i limit to 4 entries... this won't give the result. Because not every entry contains a video. Will send code when finished. – WA Design Feb 13 at 9:39
0
        <?php $i = 1;?>
        {exp:channel:entries channel="nieuws" dynamic="no" limit="100"}
        {video limit="1"}
        <?php if($i < 9):?>
            <article class="video-item col-lg-3 col-md-4 col-sm-6">
                <div>
                    {video:fragment}
                    <a href="{page_uri}">
                        <h3>{title}</h3>
                    </a>
                </div>
            </article>
            <?php if($i == 4):?><div class='clearfix'></div><?php endif;?>

            <?php $i++;?>
        <?php endif; ?> 
        {/video}
        {/exp:channel:entries} 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.