Use th:replace to create a reusable navigation component in Thymeleaf HTML with Spring Boot
Vložit
- čas přidán 17. 10. 2020
- Do you want to create an HTML fragment that can be used in multiple HTML pages? In this video, I use Thymeleaf's th:fragment and th:replace attributes to extract a nav bar from an existing page, create a fragment page for it, and then include that fragment content back in the original page. I also explore a few intermediate concepts with Bootstrap's NavBar attribute.
Source code is freely available on GitHub: github.com/discospiff/SpringB...
This video is part of a playlist on Microservices and Spring Boot with IntelliJ IDEA: • IntelliJ IDEA, Git, Gi...
Awesome ! Made easy to understand !
I'm glad it helped! Using components is Spring Boot/Thymeleaf is a great way to have a modular, consistent design.
Great explanation !
Glad it helped! Thanks for watching.
That's great! Thanks Brandan!
Glad it helped! Thanks for taking the time to comment.
thanks..
great explanation
Thanks! I appreciate the feedback.
i swear im doing the samething and it's not working lol
Do you see anything in View-Source when this renders in a browser?
@@discospiff i don't see anything form the other file
@@towersofhanoi same here, lol
@@towersofhanoi Did you import 'thymeleaf-layout-dialect' via gradle/maven? That was my stupid mistake.