287Tags
Free labels with a color. The URL slug is created from the name.
Try it
Tag preview
How active tags look on a product page. The small text is the slug used in URLs.
Best Seller/best-seller
Clearance/clearance
Eco Friendly/eco-friendly
Imported/imported
Limited Edition/limited-edition
Made in Thailand/made-in-thailand
New Arrival/new-arrival
Promotion/promotion
Add a tag and leave the slug empty: TagService.slugify("Made in Thailand!") β made-in-thailand.
| # | Name | Slug | Color | Status | |
|---|---|---|---|---|---|
| 2 | Best Seller | best-seller | #f59e0b | Active | βοΈ |
| 8 | Clearance | clearance | #64748b | Active | βοΈ |
| 4 | Eco Friendly | eco-friendly | #16a34a | Active | βοΈ |
| 6 | Imported | imported | #0891b2 | Active | βοΈ |
| 5 | Limited Edition | limited-edition | #9333ea | Active | βοΈ |
| 7 | Made in Thailand | made-in-thailand | #db2777 | Active | βοΈ |
| 1 | New Arrival | new-arrival | #2563eb | Active | βοΈ |
| 3 | Promotion | promotion | #dc2626 | Active | βοΈ |
Showing 1β8 of 8
π Learn: how this master is built table tag
Key points
- beforeSave hook: TagService.slugify("Made in Thailand") β made-in-thailand.
- Two UNIQUE constraints (uq_tag_name, uq_tag_slug): the database is the final guard against duplicates.
Code
- Entity
domain/Tag.java- Repository
repo/TagRepository.java- Definition
MasterRegistry: "tags"- Page / form
web/MasterController.java- Try-it panel
templates/tools/tag-cloud.html- REST API
GET /api/masters/tags
SQL to try in SSMS (database MasterDataLabDB)
SELECT name, slug, color FROM tag WHERE active = 1 ORDER BY name;