-
Notifications
You must be signed in to change notification settings - Fork 184
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
Added label display control #41
base: master
Are you sure you want to change the base?
Conversation
added label display control
added label display control
label display management (updating merge request)
I'm really struggling with this exact same issue right now. In essence, label tags without an value are getting rendered, messing with the alignment of my page. What are the chances we include this in the official release? |
depends on the repo owner. You can still fork my version for now. |
Hi @zoner14 I will get this pull request merged and release tomorrow. I just get back from release a new product of my company. |
This is actually my first time using Github. I'm shocked how easy this was. Thank you so much! I really didn't want to have to hack together my own solution such that it differed from the standard release. |
@diopib @zoner14 Why not just turn label off by setting it in Form? Like this
though ModelForm will be a little bit more complex |
@tzangms |
In Django 1.6, it allows you to override
I think it's the way that Django works, settings things up in Form, but not to increase the complexity in template. if you turn of label in Form/ModelForm, you can use just one line in template.
but seperate every fields into template, and turn one field's label off. |
@tzangms |
So I actually had first tried setting the label equal to null, and this actually does not work. The API still renders the label. Here is what one of my form fields looks like:
and here is how it renders in HTML after calling {{ form|bootstrap}} Suffice to say, the label renders like this:< label class="control-label " for="id_username"> |
Still thinking that changes have to be made on your app, you shouldn't have to "tweak" a django form to achieve that. You should manage the display on the template, not elsewhere (good practice). |
added feature to hide label or not.
example: {{ field|bootstrap:False}}