You would only need to include that file in the build.json file if it was js code. Otherwise if the path is correct, frappe will override with your custom html file.
▲ [WARNING] [plugin frappe-html] There was an error importing /home/frappe/frappe-bench/apps/myapp/myapp/public/js/templates/saabits/ui/toolbar/navbar.html
../myapp/myapp/public/js/myapp.bundle.js:2:7:
2 │ import "./templates/myapp/ui/toolbar/navbar.html";
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I think it should be fine to include .html templates in the bundle. apps/erpnext/erpnext/public/js/erpnext.bundle.js includes quite a few HTML templates without any problems.
However, I don’t think this is what I need to do. I really need to find the correct path to put my navbar.html in to override the nav-bar in the desk view. If I put an edited navbar.html in apps/myapp/myapp/templates/includes/navbar/navbar.html, without putting it in the bundle, then it correctly overrides the nav-bar in the web-site view but that isn’t what I’m trying to do.
Thank you, Darshit.
That is a great way to customise the nav-bar for the website view without using a custom app. However, I could not see how to use it to customise the nav-bar for the desk view, which is what I am trying to customise.
Hello @BillJ , I managed to override the nav bar in desk view by running frappe build after writing some custom code and embedded CSS in navbar.html. Please let me know if you manage.
Hi @BillJ Just keep a back up of your navbar.html (for desk) and override the existing one and once you’re done writing your custom code run “bench build”.
[quote=“Brianmbewe, post:13, topic:107252, full:true”]
Hi @BillJ Just keep a back up of your navbar.html (for desk) and override the existing one and once you’re done writing your custom code run “bench build”.[/quote]
Thanks, Brian. I can do it that way and I know it will work but I was hoping to find the way to override it in my custom app without having to edit any core files.
@bahaou I need to add code to the template but I will bear in mind that I can include CSS using the hook file because I’m sure I will need to style it too. Thank you.
That’s what I want to do too. I still haven’t found out how to do it. I don’t want to modify the core code. I want to override the navbar in desk view with my custom app.