当前位置:网站首页>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 .
边栏推荐
- Annual comprehensive analysis of China's audio market in 2022
- Synchronization mechanism of dual namenodes
- Adaoracle supports multi chain distributed Oracle with wide area node quotation
- Halcon: discrete digital OCR recognition
- Data center table reports realize customized statistics, overtime leave summary record sharing
- [multithreading] thread communication scheduling, waiting set wait(), notify()
- 09 route guard authenticates URL
- C语言课程设计
- Cloud security daily 220216: root privilege escalation vulnerability found on IBM SaaS integration platform needs to be upgraded as soon as possible
- Sword finger offer 22 The penultimate node in the linked list
猜你喜欢
leetcode 82. Delete duplicate Element II in the sorting linked list
Smart wind power | Tupu software digital twin wind turbine equipment, 3D visual intelligent operation and maintenance
Oracle概念二
Alibaba cloud liupeizi: Inspiration from cloud games - innovation on the end
Byte + Google super full kotlin learning King fried notes! Kotlin introductory tutorial + Advanced kotlin enhanced actual combat (with demo)
leetcode 142. Circular linked list II
事件监听机制
All you want to know about large screen visualization is here
Event listening mechanism
Synchronization mechanism of dual namenodes
随机推荐
C language course design
localDateTime类型的时间(2019-11-19T15:16:17) 用oracle的时间范围查询
Data center table reports realize customized statistics, overtime leave summary record sharing
428-二叉树(501.二叉搜索树中的众数、701.二叉搜索树中的插入操作、450.删除二叉搜索树中的节点、669. 修剪二叉搜索树)
2022年中国音频市场年度综合分析
Sliding window + monotone queue concept and example (p1886 Logu)
428 binary tree (501. mode in binary search tree, 701. insert operation in binary search tree, 450. delete node in binary search tree, 669. prune binary search tree)
米哈游起诉五矿信托,后者曾被曝产品暴雷
【多线程】线程通信调度、等待集 wait() 、notify()
Yyds dry inventory brief chrome V8 engine garbage collection
Kubernetes基础自学系列 | Ingress API讲解
Ten common methods of arrays tools
Simulated process scheduling
Introduction to photoswape
About how vs2019c # establishes the login interface, the user name and password entered must match the records in the access database
Ping An technology's practice of migrating from Oracle to ubisql
LeetCode每日一练(两数之和)
ROS "topic" programming implementation
10 minutes to master the installation steps of MySQL
Pragma once Usage Summary