Template:VerseBlock: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<div class="verse-block" id="{{{verse_id}}}" | <!-- | ||
Template:VerseBlock (refactored — generic commentary support) | |||
══════════════════════════════════════════════════════════════ | |||
Renders a verse with any number of named commentaries. | |||
Commentary subpages are looked up by slug using #lst. | |||
Core parameters: | |||
document_id – e.g. NNS (required) | |||
chapter_id – e.g. NNS_C01 (required) | |||
verse_id – e.g. NNS_C01_V01 (required) | |||
verse_type – mantra | shloka | gatha | sutra (required) | |||
page_title – Wiki page name, e.g. Nakha (required) | |||
verse_text – The verse itself (required) | |||
Commentary slots (repeat up to 5 times): | |||
commentary1 – slug, e.g. balabodhini | |||
label1 – display label, e.g. बालबोधिनी | |||
commentary2 – slug, e.g. mandabodhini | |||
label2 – e.g. मन्दबोधिनी | |||
commentary3 / label3 | |||
commentary4 / label4 | |||
commentary5 / label5 | |||
Commentary subpage convention: | |||
{page_title}/व्याख्या/{slug} | |||
Section label within that subpage = {verse_id} | |||
Example (Nakha page, same as before): | |||
{{VerseBlock | |||
| document_id = NNS | |||
| chapter_id = NNS_C01 | |||
| verse_id = NNS_C01_V01 | |||
| verse_type = mantra | |||
| page_title = Nakha | |||
| verse_text = पान्त्वस्मान् ... | |||
| commentary1 = balabodhini | |||
| label1 = बालबोधिनी | |||
| commentary2 = mandabodhini | |||
| label2 = मन्दबोधिनी | |||
}} | |||
Example (different document, different commentaries): | |||
{{VerseBlock | |||
| document_id = IU | |||
| chapter_id = IU_C01 | |||
| verse_id = IU_C01_V01 | |||
| verse_type = mantra | |||
| page_title = Ishavasya | |||
| verse_text = ईशावास्यमिदँ सर्वम् ... | |||
| commentary1 = shankarabhashya | |||
| label1 = शाङ्करभाष्यम् | |||
| commentary2 = anandagiri | |||
| label2 = आनन्दगिरिः | |||
| commentary3 = rangamanuja | |||
| label3 = रङ्गरामानुजः | |||
}} | |||
--> | |||
<div | |||
class="verse-block" | |||
id="{{{verse_id}}}" | |||
style="margin:1.5em 0;padding:14px 18px;background:#fffef8; | style="margin:1.5em 0;padding:14px 18px;background:#fffef8; | ||
border:1px solid #e0cfa0;border-radius:4px;"> | border:1px solid #e0cfa0;border-radius:4px;"> | ||
<div class="verse-text" | |||
style="font-family:serif;font-size:1.1em;line-height:2;padding:8px 0;"> | <!-- Verse text --> | ||
<div class="verse-text" | |||
style="font-family:'Adishila','Noto Serif Devanagari','Noto Serif Kannada',serif; | |||
font-size:1.1em;line-height:2;padding:8px 0; | |||
direction:auto;unicode-bidi:plaintext;"> | |||
<p>{{{verse_text}}}</p> | <p>{{{verse_text}}}</p> | ||
</div> | </div> | ||
{{#if:{{{ | <!-- Commentary slot 1 --> | ||
{{#if:{{{commentary1|}}}| | |||
{{Commentary | |||
| verse_id = {{{verse_id}}} | |||
| name = {{{commentary1}}} | |||
| label = {{{label1|{{{commentary1}}}}}} | |||
| text = {{#lst:{{{page_title}}}/व्याख्या/{{{commentary1}}}|{{{verse_id}}}}} | |||
}}}} | |||
<!-- Commentary slot 2 --> | |||
{{#if:{{{commentary2|}}}| | |||
{{Commentary | |||
| verse_id = {{{verse_id}}} | |||
| name = {{{commentary2}}} | |||
| label = {{{label2|{{{commentary2}}}}}} | |||
| text = {{#lst:{{{page_title}}}/व्याख्या/{{{commentary2}}}|{{{verse_id}}}}} | |||
}}}} | |||
<!-- Commentary slot 3 --> | |||
{{#if:{{{commentary3|}}}| | |||
{{Commentary | |||
| verse_id = {{{verse_id}}} | |||
| name = {{{commentary3}}} | |||
| label = {{{label3|{{{commentary3}}}}}} | |||
| text = {{#lst:{{{page_title}}}/व्याख्या/{{{commentary3}}}|{{{verse_id}}}}} | |||
}}}} | |||
<!-- Commentary slot 4 --> | |||
{{#if:{{{commentary4|}}}| | |||
{{Commentary | {{Commentary | ||
|verse_id={{{verse_id}}} | | verse_id = {{{verse_id}}} | ||
|name= | | name = {{{commentary4}}} | ||
|label= | | label = {{{label4|{{{commentary4}}}}}} | ||
|text={{#lst:{{{page_title}}}/व्याख्या/ | | text = {{#lst:{{{page_title}}}/व्याख्या/{{{commentary4}}}|{{{verse_id}}}}} | ||
}}}} | }}}} | ||
{{#if:{{{ | <!-- Commentary slot 5 --> | ||
{{#if:{{{commentary5|}}}| | |||
{{Commentary | {{Commentary | ||
|verse_id={{{verse_id}}} | | verse_id = {{{verse_id}}} | ||
|name= | | name = {{{commentary5}}} | ||
|label= | | label = {{{label5|{{{commentary5}}}}}} | ||
|text={{#lst:{{{page_title}}}/व्याख्या/ | | text = {{#lst:{{{page_title}}}/व्याख्या/{{{commentary5}}}|{{{verse_id}}}}} | ||
}}}} | }}}} | ||
</div> | </div> | ||
{{VerseRow | {{VerseRow | ||
| document_id | | document_id = {{{document_id|}}} | ||
| chapter_id | | chapter_id = {{{chapter_id|}}} | ||
| verse_id | | verse_id = {{{verse_id}}} | ||
| verse_type | | verse_type = {{{verse_type|}}} | ||
| verse_text | | verse_text = {{{verse_text}}} | ||
| | | commentary1 = {{{commentary1|}}} | ||
| | | commentary2 = {{{commentary2|}}} | ||
| commentary3 = {{{commentary3|}}} | |||
| commentary4 = {{{commentary4|}}} | |||
| commentary5 = {{{commentary5|}}} | |||
}} | }} | ||
Revision as of 07:34, 10 March 2026
{{{verse_text}}}