https://github.com/jmix-framework/jmix-webcontent
https://github.com/jmix-framework/jmix-webcontent
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jmix-framework/jmix-webcontent
- Owner: jmix-framework
- Created: 2024-04-04T08:46:30.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-29T10:25:09.000Z (almost 2 years ago)
- Last Synced: 2024-05-29T23:38:04.490Z (almost 2 years ago)
- Language: Java
- Size: 55.7 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Jmix WebContent Addon
Allows to use content stored in database and editable from the admin area
# Installation
1. Checkout this repo
2. build and publish artifacts to your Maven
```
./gradlew publishToMavenLocal
```
3. Select Install Manually from Jmix Addon Manager and insert addon's artifactId
```
io.jmix.webcontent:webcontent-starter:0.0.1
```
# Usage
## Code
By default web content is taken by user selected locale fallbacking to 'en'.
Consider you have div on view with id "instructions" and web content with
the same slug field value:
```
WebContent instructionWebContent = webContentService.findBySlug("instructions");
instructions.getElement().setProperty("innerHTML", instructionWebContent.getContents());
```
## Migrations
To have contents installed automatically, use liquibase changesets as follows:
1. Create new migration changeset
2. Add changeset contents
```xml
```
3. Place your htmls with contents aside the changeset