Laravel Nova 模板定制
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/52370915/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Laravel Nova template customization
提问by Dayron Gallardo
I started to do some tests on the new administration panel Laravel Nova. I read the documentation and didn't find any mention of how we can do some template customization.
我开始在新的管理面板 Laravel Nova 上做一些测试。我阅读了文档,但没有发现任何关于我们如何进行模板定制的提及。
Anybody can explain how the template engine works? It's there any way to override some pages components output?
谁能解释一下模板引擎是如何工作的?有什么方法可以覆盖某些页面组件输出?
How do I need to proceed if I want to change the logo or the footer, or the navbar WITHOUTmodifying the originals files?
如果我想在不修改原始文件的情况下更改徽标或页脚或导航栏,我需要如何继续?
回答by user1453870
After publishing nova, a new folder named "nova" should have been created under resources/views/vendor/
. The logo file should already be there.
发布 nova 后,应该已经在resources/views/vendor/
. 徽标文件应该已经存在。
If not, create it. You can look into nova/resources
for the filenames.
如果没有,请创建它。您可以查看nova/resources
文件名。
After that you can simply create a file named the same way as another template in nova/resources/views
and it will load the proper one.
之后,您可以简单地创建一个以与另一个模板相同的方式命名的文件nova/resources/views
,它将加载正确的文件。
From there you can override the vue-router and add your js and css.
从那里你可以覆盖 vue-router 并添加你的 js 和 css。
So your resources folder path for the logo file would look something like this
因此,徽标文件的资源文件夹路径将如下所示
resources/views/vendor/nova/partials/logo.blade.php
resources/views/vendor/nova/partials/logo.blade.php