Comments (4)
@Chris-ZA, your suggestions lead me out of tunnel vision.
The way it is has been implemented is simple.
From the template, you can enable the help_text in two ways.
# Enable with render_form
{% render_form form_class _help=1 %}
# Enable for individual field; note the initial underscore
{% render_field form_class.myfield _help=1 %}
# Enable for one field, but not rest of the form
# help=0/False is default
{% render_form form_class exclude="myfield" %}
{% render_field form_class.myfield _help=1 %}
You can also set the help text element's class by setting a SUI_HELP_CLASS
.
SUI_HELP_CLASS = "ui help"
Or override the entire template.
SUI_HELP_TEMPLATE = "<div class=\"ui help\">{}</div>
I will be pushing this feature up as soon as I update the README.md. Thanks guys!
from django-semanticui-forms.
The only way I could see this happening without disturbing everything else is to let it have its own field called HelpTextField
and then using the _override
attribute.
Would this be satisfactory and if not, would you have any better recommendations?
Putting the help_text
with it by default would not be an entirely great idea considering, as you said, Semantic UI does not have specific support for help text.
from django-semanticui-forms.
I was coming here to ask for this as well. Great timing @samkuehn. :)
I was going to ask for support for the model help_text to be displayed in some way and maybe be controlled by some parameters on the form or the field...
{% render_form form display_help_text=true %}
or
{% render_field form.name display_help_text=true, help_text_class="ui help" %}
I've only just started learning Django over the past 2 weeks so if what I'm asking for is not possible then disregard this completely. :)
from django-semanticui-forms.
Awesome. Thank you very much!
I will deploy to my project later and give it a test.
from django-semanticui-forms.
Related Issues (20)
- Checkboxes are requiring intitialization with Javascript HOT 3
- Property added in forms.py does not come through to field HOT 1
- Metadata on <input type="number"> HOT 4
- Layout Requested HOT 3
- Placement of classes in forms.py HOT 2
- Formsets HOT 1
- data-value in dropdown HOT 9
- How to render icon inside search selection dropdown? HOT 1
- Initial ChoiceField value ignored when boolean
- Field div could have id allowing easily hooking up some JS
- ChoiceField breaks if choices is a callable
- Choice fields break with non-ascii choices
- ChoiceField Search always returns undefined HOT 1
- How to set style on FormSet?
- ModelChoiceField dropdown does not work
- Extend library
- Hidden fields render visible HOT 2
- Inline fields HOT 2
- Typo in Attributes explanation HOT 1
- Django forms empty_label not rendering in dropdown HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-semanticui-forms.