主题管理
manage-themes
暂无简介
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-12
- Stars
- ★ 178
- Forks
- 222
02 资源文件 5
- 参考文档references/ASCII.md4.3 KB
- 参考文档references/BLOG.md20.2 KB
- 参考文档references/HTML.md7.6 KB
- 参考文档references/PR-BLOG.md17.6 KB
- 参考文档references/ZINE.md21.9 KB
03 SKILL.md 正文
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->
name: manage-themes description: Manage OFBiz Visual Themes. Use when defining theme resources (CSS/JS), creating theme variations, or managing LESS files.
Skill: manage-themes
Goal
Configure and customize the visual appearance of OFBiz applications using the Visual Theme system.
Triggers
ALWAYS read this skill when:
- Creating a new theme component.
- Modifying CSS, JS, or LESS resources for a specific theme.
- Adding theme variations (e.g., color schemes).
Use when
- Defining
VisualThemeandVisualThemeResourceentities. - Registering theme data in
ofbiz-component.xml. - Managing template locations and styling assets.
Procedure
- Define VisualTheme:
- The root record for a theme.
- Fields:
visualThemeId,visualThemeSetId(e.g.,BACKOFFICE,ECOMMERCE),displayName.
- Define Theme Resources:
- Use
VisualThemeResourceto attach assets (CSS, JS, Favicons) to the theme. - Fields:
visualThemeId,resourceTypeEnumId(e.g.,VT_STYLESHEET,VT_SCRIPT),sequenceId,resourceValue.
- Use
- LESS Compilation (if applicable):
- OFBiz themes often use LESS. Link the compiled CSS or the variable files in the resource records.
- Register in Component Context:
- Ensure the theme data file is registered in
ofbiz-component.xmlvia<entity-resource type="data" .../>.
- Ensure the theme data file is registered in
Guardrails
- Resource Ordering: Use
sequenceIdinVisualThemeResourceto ensure correct loading order of CSS/JS. - Paths: Use standard webapp paths or component-relative paths for assets.
Examples
Example: Defining a Theme and CSS Resource
<entity-engine-xml>
<VisualTheme visualThemeId="MY_MODERN_THEME" visualThemeSetId="BACKOFFICE" displayName="My Modern Theme"/>
<!-- Link Global Stylesheet -->
<VisualThemeResource visualThemeId="MY_MODERN_THEME" resourceTypeEnumId="VT_STYLESHEET"
sequenceId="01" resourceValue="/my-assets/css/main-style.css"/>
<!-- Link Theme-specific JS -->
<VisualThemeResource visualThemeId="MY_MODERN_THEME" resourceTypeEnumId="VT_SCRIPT"
sequenceId="01" resourceValue="/my-assets/js/theme-init.js"/>
</entity-engine-xml>
Example: Theme Variation (Sub-Theme)
<entity-engine-xml>
<VisualTheme visualThemeId="MY_MODERN_DARK" visualThemeSetId="BACKOFFICE" displayName="Modern Dark"/>
<VisualThemeResource visualThemeId="MY_MODERN_DARK" resourceTypeEnumId="VT_SCREEN_SHOT"
resourceValue="/my-assets/images/dark-preview.png"/>
</entity-engine-xml>