New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit modifier doesn't work on list stored in global #1482

Closed
gmcz opened this Issue Jun 28, 2017 · 7 comments

Comments

Projects
None yet
3 participants
@gmcz

gmcz commented Jun 28, 2017

Expected behaviour

Output should be vales of list, limited according to the value passed in the limit modifier.

Actual behaviour

Output is something like "callback_blocks_3c3b7c7a7...".

Steps to reproduce

  1. Create a list in a named global fieldset
  2. Attempt to limit the output of that list with the limit modifier

Server Details

Statamic Version: 2.5.11

@gmcz

This comment has been minimized.

gmcz commented Jun 28, 2017

For anyone else with this issue: My workaround is to use CSS's nth-child psudeoselector to display: none; these items. Here's CSS-Tricks useful :nth Tester, because math.

@jackmcdade

This comment has been minimized.

Member

jackmcdade commented Jun 28, 2017

What's your template code?

@gmcz

This comment has been minimized.

gmcz commented Jun 28, 2017

Here's the template: (it's actually a partial)

<ul>
    {{ globalfieldset.list limit="3" }}
    <li>{{ value }}</li>
    {{ /globalfieldset.list }}
</ul>

<ul>
    {{ globalfieldset.list offset="3" limit="3" }}
    <li>{{ value }}</li>
    {{ /globalfieldset.list }}
</ul>

Everything works if I remove the modifiers.

@jackmcdade

This comment has been minimized.

Member

jackmcdade commented Jun 28, 2017

Can you use colons instead of periods? E.g.

<ul>
    {{ globalfieldset:list limit="3" }}
    <li>{{ value }}</li>
    {{ /globalfieldset:list }}
</ul>
@gmcz

This comment has been minimized.

gmcz commented Jun 28, 2017

I just gave that a shot and it results in the same "callback_blocks..." output.

@jackmcdade

This comment has been minimized.

Member

jackmcdade commented Jun 28, 2017

Ok, looking into it. (You should not use periods btw, just get in the habit of using colons :)

@gmcz

This comment has been minimized.

gmcz commented Jun 28, 2017

Will do! Thanks, Jack. Again: it's not a showstopper because this is a little list and css can hide it for me. However, this probably isn't how you want it to work. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment