with_scope checkbox value #407

Closed
gabrielnau opened this Issue May 16, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@gabrielnau
Contributor

gabrielnau commented May 16, 2012

Hi,

I come across a weird problem with this tag :

here is my content type :

name: artists
order_by: name
order_direction: asc
slug: artists
label_field_name: name
fields:

  • name:
    required: true
    label: name
    type: string
  • image:
    required: true
    label: image
    type: file
  • guest:
    label: guest
    type: boolean
    required: false
  • link:
    label: link
    type: string
    required: true

and in my page, I want to display a column of "guest = true" and another of "guest = false", but the only way to do so was :

{% with_scope guest: true %}
{% for artist in contents.artists %}
{% include 'single_artist' %}
{% endfor %}
{% endwith_scope %}

{% with_scope guest: no %}
{% for artist in contents.artists %}
{% include 'single_artist' %}
{% endfor %}
{% endwith_scope %}

So, for guest = true I have to do with_scope guest: true, and for guest = false I have to do with_scope guest: no

Thanks !
Gabriel

@did

This comment has been minimized.

Show comment Hide comment
@did

did May 30, 2012

Member

hey @gabrielnau. Actually, unless you enabled and disabled the checkbox, its value by default was nil which is different from false.
In other words, basically, all new content entries were saved in mongodb with checkboxes (boolean fields) set to nil...
Now, the default value is forced to false.
thanks !

Member

did commented May 30, 2012

hey @gabrielnau. Actually, unless you enabled and disabled the checkbox, its value by default was nil which is different from false.
In other words, basically, all new content entries were saved in mongodb with checkboxes (boolean fields) set to nil...
Now, the default value is forced to false.
thanks !

@did did closed this May 30, 2012

@gabrielnau

This comment has been minimized.

Show comment Hide comment
@gabrielnau

gabrielnau May 31, 2012

Contributor

Thank you !

Contributor

gabrielnau commented May 31, 2012

Thank you !

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