Jump to content

Template:Concept: Difference between revisions

From example
Create Concept template for lorebook demo
 
m Protected "Template:Concept" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>[[Category:Concept]]
<includeonly>[[Category:Concept]]
[[Belongs to world::{{{world|}}}]]
{{#set:
{{#if:{{{parent|}}}|[[Parent concept::{{{parent}}}]]|}}
Belongs to world={{{world|}}}
{{#if:{{{plist|}}}|[[Plist::{{{plist}}}]]|}}
|{{#if:{{{parent|}}}|Parent concept={{{parent}}}|}}
{{#if:{{{alichat|}}}|[[AliChat::{{{alichat}}}]]|}}
|{{#if:{{{plist|}}}|Plist={{{plist}}}|}}
{{#if:{{{primary|}}}|[[Primary keys::{{{primary}}}]]|}}
|{{#if:{{{alichat|}}}|AliChat={{{alichat}}}|}}
{{#if:{{{secondary|}}}|[[Secondary keys::{{{secondary}}}]]|}}
|{{#if:{{{primary|}}}|Primary keys={{{primary}}}|}}
{{#if:{{{logic|}}}|[[Logic::{{{logic}}}]]|}}
|{{#if:{{{secondary|}}}|Secondary keys={{{secondary}}}|}}
{{#if:{{{mode|}}}|[[Key mode::{{{mode}}}]]|}}
|{{#if:{{{logic|}}}|Logic={{{logic}}}|}}
{{#if:{{{placement|}}}|[[Placement::{{{placement}}}]]|}}
|{{#if:{{{mode|}}}|Key mode={{{mode}}}|}}
{{#if:{{{nonrecursable|}}}|[[Non-recursable::{{{nonrecursable}}}]]|}}
|{{#if:{{{placement|}}}|Placement={{{placement}}}|}}
|{{#if:{{{nonrecursable|}}}|Non-recursable={{{nonrecursable}}}|}}
}}
<div class="lorebook-concept" style="border: 1px solid #a2a9b1; border-radius: 4px; padding: 15px; margin: 10px 0; background: #f8f9fa;">
<!-- Header -->
<div style="font-size: 1.2em; font-weight: bold; margin-bottom: 10px; color: #202122; border-bottom: 2px solid #0645ad; padding-bottom: 5px;">
📚 Concept: {{PAGENAME}}
</div>
 
<!-- World & Parent Info -->
<div style="margin-bottom: 12px; padding: 8px; background: white; border-left: 3px solid #0645ad;">
<strong>🌍 World:</strong> [[{{{world|}}}]]{{#if:{{{parent|}}}| &nbsp;→&nbsp; <strong>Parent:</strong> [[{{{parent}}}]]|}}
</div>
 
<!-- Trigger Settings -->
<div style="display: inline-block; margin-bottom: 12px; padding: 6px 10px; background: #eaecf0; border-radius: 3px; font-size: 0.9em;">
<strong>⚙️ Trigger:</strong>
<span style="background: {{#switch:{{{mode|conditional}}}|constant=#90EE90|conditional=#87CEEB|disabled=#FFB6C6|#87CEEB}}; padding: 2px 6px; border-radius: 3px; color: #000;">{{#if:{{{mode|}}}|{{{mode}}}|conditional}}</span>
&nbsp;|&nbsp;
<strong>Logic:</strong> <code>{{#if:{{{logic|}}}|{{{logic}}}|ANY}}</code>
{{#if:{{{placement|}}}|&nbsp;|&nbsp; <strong>Placement:</strong> <code>{{{placement}}}</code>|}}
{{#if:{{{nonrecursable|}}}|&nbsp;|&nbsp; <strong>Non-recursable:</strong> {{{nonrecursable}}}|}}
</div>
 
<!-- Keys Section -->
{{#if:{{{primary|}}}|
<div style="margin-bottom: 10px; padding: 8px; background: #fff3cd; border-left: 3px solid #ffc107;">
<strong>🔑 Primary Keys:</strong> <code style="background: white; padding: 2px 4px; border-radius: 2px;">{{{primary}}}</code>
</div>
|}}
{{#if:{{{secondary|}}}|
<div style="margin-bottom: 10px; padding: 8px; background: #d1ecf1; border-left: 3px solid #17a2b8;">
<strong>🔑 Secondary Keys:</strong> <code style="background: white; padding: 2px 4px; border-radius: 2px;">{{{secondary}}}</code>
</div>
|}}
 
<!-- PList Content -->
{{#if:{{{plist|}}}|
<div style="margin-bottom: 12px; padding: 10px; background: #e7f3ff; border-left: 4px solid #0645ad; border-radius: 2px;">
<div style="font-weight: bold; margin-bottom: 5px; color: #0645ad;">📝 PList Description:</div>
<div style="font-family: 'Courier New', monospace; background: white; padding: 8px; border-radius: 3px; white-space: pre-wrap;">{{{plist}}}</div>
</div>
|}}
 
<!-- AliChat Content -->
{{#if:{{{alichat|}}}|
<div style="margin-bottom: 10px; padding: 10px; background: #f0f0ff; border-left: 4px solid #6c63ff; border-radius: 2px;">
<div style="font-weight: bold; margin-bottom: 5px; color: #6c63ff;">💬 Ali:Chat Dialogue:</div>
<div style="font-family: 'Courier New', monospace; background: white; padding: 8px; border-radius: 3px; white-space: pre-wrap; font-size: 0.95em;">{{{alichat}}}</div>
</div>
|}}
</div>
</includeonly><noinclude>
</includeonly><noinclude>
== Concept template ==
== Concept template ==

Latest revision as of 19:39, 17 October 2025

Concept template

This template stores a lore or environment concept using Semantic MediaWiki properties.

Core parameters

world
Name of the parent world page (required for categorisation).
parent
Optional parent concept (enables recursive triggering).
plist
PList-style description content.
alichat
Optional Ali:Chat style reaction text.
primary / secondary
Comma-separated key lists. Combine with logic to reproduce Lorebook conditions.
logic
ANY (default), AND, or NOT.
mode
constant, conditional (default), or disabled.
placement / nonrecursable
Additional hints controlling injection order and recursion.

Example

{{Concept
 |world=Farlandia
 |parent=Farlandia:Monsters
 |plist=[slime: enemy, slimeball, made of gelatin, bounces to move, annoyance]
 |alichat={{user}}: Slime?
{{char}}: "Oh... Those things." She blushes, remembering their first battle.
 |primary=slime,slimes
 |logic=ANY
 |mode=conditional
 |placement=depth:5
}}