21.
Tweaking the Form Layout
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
Whoops, an error! Please, try again later.
9 Comments
Hi, thanks for the tutorial, which helped me a lot also in using EasyAdmin3.
But I struggle to implement a "two column" layout.
This is "reducing" the width correctly
<br />public function configureFields(string $pageName): iterable<br />{ <br />[...]<br />yield FormField::addPanel('Some Headline 1')->setCssClass('col-sm-6')<br />yield FormField::addPanel('Some Headline 2')->setCssClass('col-sm-6')<br />[...]<br />}<br />but the blocks are not next to each other. Do you have a tip what I can do?
Hey @Tim!
> Hi, thanks for the tutorial, which helped me a lot also in using EasyAdmin3
Happy to hear it's useful even if it's not WAY old :).
> but the blocks are not next to each other. Do you have a tip what I can do?
I'm not familiar with the HTML and layout that EasyAdmin 3 uses. For this to work, in the rendered HTML, both those elements would need to be inside their own <div class="row"> element. What do you see in the rendered HTML?
Cheers!
Hi, thanks for the tutorial.
You said that we were going to fix the order later (for the slug field). Is that in another chapter of the EasyAdminBundle tutorial?
Hey Matias,
Yes, it should be in further chapters :)
Cheers!
Hi there !
Do you think it's possible to hide a whole group in the 'new' view ?
Regards.
Hey Kaizoku!
Sorry for the slow reply! Hmm, I doubt this is possible :/. The groups don't even have named keys in yml, so there would be no way to even do a
-groupNametype of thing to remove it :/. I think, unfortunately, that your best option is to specify new and edit forms independently (the unfortunate part is the duplication). I had another possible idea, which was to use a custom form class for the entire form, and build the fields & groups yourself (and then you could just some PHP logic), but that's not currently possible.Cheers!
Thanks for the answer.
Actually it's not a big deal as I'm removing the fields with a -field, so I just have the panel title with and empty body.
I guess I can use some JS to hide the panel, but it's really not important.
Hey Kaizoku ,
Yeah, JS can do the trick, but I bet it's possible to override some templates and hide it on the backend level instead.
Cheers!
This worked for me:
"Houston: no signs of life"
Start the conversation!