当前位置:网站首页>Jeesite 4.0 replaces the default view style and customizes the theme
Jeesite 4.0 replaces the default view style and customizes the theme
2022-06-27 17:21:00 【ThinkGem】
Replace the default view style
The needs of each project are different , The style requirements are also different , For example, I would like to modify the next landing page 、 Frame page 、 Error page waiting , That's in JeeSite4.0 How to override the default view in ?
1、 Let's take a look at SpringMVC View configuration :
// Beetl Topic view parser (order The smaller, the higher the priority )
BeetlViewResolver beetlThemes = new BeetlViewResolver();
beetlThemes.setPrefix("/themes/" + Global.getProperty("web.view.themeName") + "/");
beetlThemes.setSuffix(".html");
beetlThemes.setOrder(10000);
registry.viewResolver(beetlThemes);
// Beetl The default view parser (order The smaller, the higher the priority )
BeetlViewResolver beetlDefault = new BeetlViewResolver();
beetlDefault.setPrefix("/");
beetlDefault.setSuffix(".html");
beetlDefault.setOrder(20000);
registry.viewResolver(beetlDefault);
// Default view definition , Render according to suffix (.json、.xml)
JsonView jsonView = new JsonView();
jsonView.setPrettyPrint(false);
XmlView xmlView = new XmlView();
xmlView.setPrettyPrint(false);
registry.enableContentNegotiation(jsonView, xmlView);
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
2、 We are looking at jeesite.yml Related configurations of the interior view themeName The default is default.
# Web relevant
web:
# MVC View related
view:
# System topic name , Topic views have the highest priority , If there is no view file under the theme, access the default view
# Introduce page header :'/themes/'+themeName+'/include/header.html'
# Introduce the end of the page :'/themes/'+themeName+'/include/footer.html'
themeName: default
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
3、 Experienced friends may understand at a glance , It was originally carried out according to the principle of "who loads first, who uses..." , That is to say, the higher the priority of the view is found, the higher the priority of the view will be used , Later views will be ignored . Order as follows :*/src/main/resources/views/themes/default/**/*.html --> */src/main/resources/views/**/*.html --> JSON/XML, First go to the view file under the theme directory , Use... Not found JeeSite Default , If you can't find , Then return to JSON or XML data .
4、 Let's take an example ( Modify landing page )
- Copy
/jeesite-module-core/src/main/resources/views/modules/sys/sysLogin.html File to /web/src/main/resources/views/themes/default/modules/sys/sysLogin.html Under the table of contents . - And then modify , Just copied
sysLogin.html View file contents , Change to a style you like , So it's done .
5、 If you want to load your own... In a public place css or js,JeeSite Two public documents are provided for you ,/src/main/webapp/static/common/common.css and /src/main/webapp/static/common/common.js file , You can modify it .
Custom theme , Quickly switch views
1、JeeSite 4.0 Version has provided a quick skin change function , The skin change here is not just a change css Change the color , It is , Put all the views in the system , Include landing page 、 Frame page 、 List of pp. 、 Content page , Even replace it grid Components .
2、 In the last chapter, we talked about jeesite.yml Related configurations of the interior view themeName, In fact, the idea of the last chapter is to let you modify and improve default This theme , If you want to modify a wide range of completely different UI, I suggest you choose another name . We can change this to the name of the view you remember , Such as :good, So all your view files , The resource files will all be in this directory :/src/main/resources/views/themes/good/、/src/main/resources/static/themes/good/. There are two other directories , public include The head and tail of :/themes/good/include/header.html、/themes/good/include/footer.html.
3、 There is no need to repeat how to operate , Same as the example in the previous chapter .
Back and forth
If you want to use only JeeSite As a server , Interface only , Provide client call . Later, I will focus on an article to introduce the application of front back separation , How to make JeeSite Become a server API, Provide mobile terminal or PC End (Vue or Angular) call .
边栏推荐
- C système de gestion de la charge de travail des enseignants en langues
- EMQ 助力青岛研博建设智慧水务平台
- Dark horse programmer - software testing foundation class -02-30-45 tools open browser running code, audio, video, test points, audio and video labels, layout labels. Advanced hyperlink syntax, absolu
- wheel ui
- d3dx9_ How to repair 32.dll? d3dx9_ Solution to 32.dll missing
- Mihayou sued Minmetals trust, which was exposed to product thunderstorms
- Popularization of MCU IO port: detailed explanation of push-pull output and open drain output
- 继手机之后 报道称三星也削减了电视等家电产品线的产量
- Leetcode 704. Binary search
- Halcon: discrete digital OCR recognition
猜你喜欢

数组表示若干个区间的集合,请你合并所有重叠的区间,并返回 一个不重叠的区间数组,该数组需恰好覆盖输入中的所有区间 。【LeetCodeHot100】
![[leetcode] 2. Add two numbers (user-defined listnode), medium](/img/27/1e7ce0e08d7428f0f594a3477e35df.jpg)
[leetcode] 2. Add two numbers (user-defined listnode), medium

一个机器人位于一个 m x n 网格的左上角 。机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角。问总共有多少条不同的路径?【LeetCodeHot100】

树莓派初步使用

IDE Eval reset unlimited trial reset

继手机之后 报道称三星也削减了电视等家电产品线的产量

leetcode 19. Delete the penultimate node of the linked list

What is RPC

Software testing Basics - software testing history, process, classification, benefits, limitations
锚文本大量丢失的问题
随机推荐
[Niuke's questions] nowcoder claims to have remembered all Fibonacci numbers between 1 and 100000. To test him, we gave him a random number N and asked him to say the nth Fibonacci number. If the nth
10分钟掌握mysql的安装步骤
How to modify / display GPIO status through ADB shell
Cloud security daily 220216: root privilege escalation vulnerability found on IBM SaaS integration platform needs to be upgraded as soon as possible
P4251 [scoi2015] small convex play matrix (still a little confused)
What do fast fashion brands care more about?
【牛客刷题】NowCoder号称自己已经记住了1-100000之间所有的斐波那契数。 为了考验他,我们随便出一个数n,让他说出第n个斐波那契数。如果第n个斐波那契大于6位则只取后6位。
leetcode 82. Delete duplicate Element II in the sorting linked list
2022年中国音频市场年度综合分析
Leetcode 46 Full Permutation
Part 32 supplement (32) string of ECMAScript
Etcd visualization tool: kstone deployment (I), rapid deployment based on Helm
d3dx9_ How to repair 38.dll? d3dx9_ 38. How to download a missing DLL?
d3dx9_ How to repair 25.dll? d3dx9_ 25.dll where to download
Popularization of MCU IO port: detailed explanation of push-pull output and open drain output
C語言教師工作量管理系統
Detailed explanation of various GPIO input and output modes (push-pull, open drain, quasi bidirectional port)
d3dx9_ What if 27.dll is lost? d3dx9_ How to repair 27.dll?
Qt5 signal and slot mechanism (basic introduction to signal and slot)
Redis installation