about responsiveness in Nette
- Thommie
- Member | 34
Foundation is also good. https://foundation.zurb.com/.
Last edited by Thommie (2018-04-18 15:23)
- sztanp
- Member | 9
ok I installed bootstrap (already) but what about Nette forms (I thought responsiveness would be kinda built-in…) ?
And I just did that in vendor/nette/forms/src/Forms/Form.php :
(replaced DefaultFormRenderer with Bs3FormRenderer).
Is that a right way to use Nextras ?
I noticed that it changed my Forms, making them more “bootstrap like”, but now how should I use bootstrap features, given that I don't build my forms inside html, but with Form class… ?
Last edited by sztanp (2018-04-20 09:16)
- GEpic
- Member | 566
Just render form as usually (doc here) (you don't really need to use BsFormRenderer if don't feel comfortable with it (i never used it cause you can't create precise responsive forms with it)), you can handle all situations and breakpoints individually, just wrap elements in ‘form-group’ class and add class ‘form-control’ straight to elements, for buttons you can use ‘btn btn-primary’ class or other colors, just look at bootstrap doc “how to”
Last edited by GEpic (2018-04-20 11:18)
- sztanp
- Member | 9
Ok thank you I begin to see that there are a lot of different possible
combinations to make forms with Nette.
The problem I have as I'm trying to follow your suggestion is that I've used
Multiplier to build my list of forms (basic administration page for products,
with their characteritics, etc…):
And this " template" :
I think I need to do something more like this (very partial code :)
But how can I link the form to the actual products (which was the case using control Form via Multiplier) ?
Last edited by sztanp (2018-04-20 19:05)
- old.gandalf
- Member | 17
Hello @sztanp,
from a short glimpse at your code, I don't understand what exactly your
problem is.
How would you like to “link” the form to the actual products? The snippet
with Multiplier usage seems to do exactly that, doesn't it?