I’m trying to allow the author to over ride the default of 7 grid rows to be displayed on main page of article.

I have a drop down filed (limit_override) with “default,25,50,75” to start with.

I would like to have something like this, below does not work

{if limit_override =="default"}

{grid limit="7"}


{grid limit="{limit_override}"}




I have tried stash


1 Answer 1


You should be able to work this out using something like:

    {if limit_override == "default"}
        {if grid_field_name:count <= 7}
        {if grid_field_name:count <= limit_override}

Or with Stash you could set_list for the grid output and then get_list with a conditional limit. Or in a separate channel:entries tag get and save the value of limit_override and use that as the limit parameter in the grid field in the main channel:entries. Haven't tested, and not sure which of those 3 ways is the fastest / most efficient.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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