hemu
hemu

Reputation: 3261

Broadleaf - Extending DemoSite Admin - Add new Menu and Page

I have been looking into Broadleaf since last couple of days. I have managed to run it on local tomcat with MySql. I have extended Entity for my custom requirement following Broadleaf's documentation.

Now I want to add a menu option (in left menu) in admin. I have no clue from where Broadleaf admin site displays the web page. How left menu is displayed ? How data from controller are binding with view ?

For example, if you access product page in broadleaf admin section, then URL will be http://localhost:8081/admin/product/. Following it I managed to know that it calls AdminProductController.java of framework's admin module. I looked at the code of AdminProductController.java but didn't get a clue how data is being forwarded to view. Also didn't find the product jsp/template/html.

I guess admin module is using EntityForm.java for view. If I intend to use simple jstl then is it possible?

My question how easily I can extend admin of Heat Clinic demo site to add new pages, menu items etc? If anyone has customized/extended demosite admin then please suggest.

Upvotes: 2

Views: 1254

Answers (1)

phillipuniverse
phillipuniverse

Reputation: 2045

We have some docs on how to do this at http://www.broadleafcommerce.com/docs/core/current/broadleaf-concepts/admin/admin-custom-controllers. The bottom line here is that if you want to add a new page then you can simply use normal Spring MVC as you would on the frontend. The only difference is that there are some specific ways to place new template files (which is documented on that page).

To answer your question, most URLs in the admin are handled dynamically by the AdminBasicEntityController. Most of the sections are handled generically by this controller but there are still certain instances where we needed to override things specifically, like with AdminProductController.

Also, the admin is built with Thymeleaf and not JSPs so if you want to add more pages they will need to be done with Thymeleaf.

Upvotes: 0

Related Questions