Skip to content

Translates a with_scope call for select fields#448

Closed
markwpearce wants to merge 4 commits intolocomotivecms:masterfrom
colibri-software:select_option_with_scope_fix
Closed

Translates a with_scope call for select fields#448
markwpearce wants to merge 4 commits intolocomotivecms:masterfrom
colibri-software:select_option_with_scope_fix

Conversation

@markwpearce
Copy link
Copy Markdown
Contributor

It makes it easier to write liquid for using with_scope on select fields - you just use the name of the option instead of needing to know it's id:

<h1>News posts:</h1>
{%with_scope category: 'news' %}
    {%for post in models.posts%}
    {{post.name}}

    {%endfor%}
  {%endwith_scope%}

@unconed
Copy link
Copy Markdown

unconed commented Jun 27, 2012

While this seems to fix the original problem, it broke collections without scope for me.

I've submitted a pull request on the pull request here:
colibri-software#1

Liquid error: undefined method `each_pair' for nil:NilClass
@markwpearce
Copy link
Copy Markdown
Contributor Author

I need to add some specs to this pull request too.

@aaronrenner
Copy link
Copy Markdown

This is a needed fix. Can this be merged in?

@did
Copy link
Copy Markdown
Member

did commented Aug 31, 2012

hi @aaronrenner, sure. I will do it ASAP.

@benjaminwood
Copy link
Copy Markdown
Contributor

Hey @markwpearce - would you consider rebasing your branch so I can use this? And perhaps it'll get merged too!

@markwpearce
Copy link
Copy Markdown
Contributor Author

I don't have easy access to the code anymore :)
@alexsanford Is this something you could do?

@benjaminwood
Copy link
Copy Markdown
Contributor

Thanks Mark. Anybody know a workaround for scoping by select fields? If I know the select options ObjectId can I specify it somehow in the liquid tag?

@ghost ghost assigned Papipo May 21, 2013
@Papipo Papipo closed this in 16228ff May 24, 2013
Papipo added a commit that referenced this pull request May 24, 2013
did added a commit that referenced this pull request May 28, 2013
did added a commit that referenced this pull request Jul 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants