Template:Article: Difference between revisions

From AbhiprayaVedi
No edit summary
No edit summary
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#default_form:Article_EN}}
<includeonly>
{{DISPLAYTITLE:{{{Display_Name|{{PAGENAME}}}}}}}
{{#set:
 
DisplayTitle={{{DisplayTitle|{{{Title|}}}}}}
<div class="article-wrapper">
|Date={{{Date|}}}
 
|Category={{{Category|}}}
<div class="article-header">
|Author={{{Author|}}}
<div class="article-meta">
|Image1={{{Image1|}}}
<span class="meta-line">
|Language={{{Language|}}}
{{#if:{{{Author|}}}|{{{Author}}}}}
|Introduction={{{Introduction|}}}
{{#if:{{{Author|}}}{{{Date|}}}|<span class="meta-sep"></span>}}
}}
{{#if:{{{Date|}}}|{{{Date}}}}}
{{DISPLAYTITLE:{{{DisplayTitle|{{{Title|}}}}}}}}
</span>
<templatestyles src="Template:Article/styles.css" />
{{#set:Date={{{Date|}}}|Category={{{Category|}}}}}
<div class="article-container" data-language="{{{Language|}}}">
<div class="article-header"><div class="author-info"><span class="author-name">{{{Author|}}}</span> <span class="date-info">{{#time:d-m-Y|{{{Date|}}}}}</span> <span class="category-badge">{{{Category|}}}</span></div></div>
{{#if:{{{Introduction|}}}|<div class="introduction-section">{{{Introduction|}}}</div>|}}
<div class="content-wrapper">
<div class="main-content">
{{#if:{{{Image1|}}}|<div class="image-left">[[File:{{{Image1}}}|frameless|400px|{{{Image1Caption|}}}]]<div class="image-caption">{{{Image1Caption|}}}</div></div>|}}
<div class="article-text">
{{{Content|}}}
</div>
</div>
<!-- Second Image (Centered) -->
{{#if:{{{Image2|}}}|
<div class="content-image">
[[File:{{{Image2}}}|frameless|650px|{{{Image2Caption|}}}]]
<div class="image-caption">{{{Image2Caption|}}}</div>
</div>
</div>
 
|}}
{{#if:{{{Intro|}}}|
<!-- Source Attribution -->
<div class="article-intro">
{{#if:{{{SourceName|}}}|
{{{Intro}}}
<div class="source-attribution">
<strong>Source:</strong> {{{SourceName|}}}
{{#if:{{{OriginalAuthor|}}}| • <strong>Original Author:</strong> {{{OriginalAuthor|}}}|}}
{{#if:{{{SourceURL|}}}| • [{{{SourceURL|}}} Original Article]|}}
</div>
</div>
|}}
<!-- “More in this Category” Section -->
{{#if:{{{Category|}}}|<div class="related-articles">
<h2>📄 More in {{{Category|}}}</h2>
<ul>
{{#ask:
[[Category:{{{Category|}}}]]
[[!{{FULLPAGENAME}}]]
[[Date::+]]
|?DisplayTitle
|sort=Date
|order=desc
|limit=5
|format=template
|template=RelatedArticleRow
|link=none
|headers=hide
|searchlabel=
}}
}}
 
</ul>
{{#if:{{{Thumbnail|}}}{{{Highlight1|}}}{{{Highlight2|}}}|
</div>|}}
<div class="article-floatbox">
</div>
 
<!-- Right Sidebar -->
<div class="right-sidebar">
<!-- Author Info Box -->
<div class="author-infobox">
{{#if:{{{Thumbnail|}}}|
{{#if:{{{Thumbnail|}}}|
[[File:{{{Thumbnail}}}|thumb|right|160px|{{{Thumbnail_Caption|}}}]]
<div class="author-photo">
}}
[[File:{{{Thumbnail}}}|frameless|150px]]
 
</div>
{{#if:{{{Highlight1|}}}{{{Highlight2|}}}|
|}}
<div class="article-highlights">
<div class="author-name-box">[[Author:{{{Author|}}}|{{{Author|}}}]]</div>
<h3>Highlights</h3>
{{#if:{{{Author_Bio|}}}|
<ul>
<div class="author-bio">{{{Author_Bio|}}}</div>
{{#if:{{{Highlight1|}}}|<li>{{{Highlight1}}}</li>}}
|}}
{{#if:{{{Highlight2|}}}|<li>{{{Highlight2}}}</li>}}
</ul>
</div>
</div>
}}
<!-- Highlights -->
 
{{#if:{{{Highlight1|}}}|
<div class="highlight-box">
<div class="highlight-title">💡</div>
<div class="highlight-text">{{{Highlight1|}}}</div>
</div>
</div>
}}
|}}
 
{{#if:{{{Highlight2|}}}|
<div class="article-content">
<div class="highlight-box">
 
<div class="highlight-title">💡</div>
{{#if:{{{Image1|}}}|
<div class="highlight-text">{{{Highlight2|}}}</div>
[[File:{{{Image1}}}|thumb|left|300px|{{{Image1_Caption|}}}]]
}}
 
{{{Content}}}
 
{{#if:{{{Image2|}}}|
[[File:{{{Image2}}}|thumb|right|300px|{{{Image2_Caption|}}}]]
}}
 
</div>
</div>
 
|}}
{{#if:{{{Translator|}}}{{{Source|}}}|
<!-- Key Points -->
<div class="article-source">
{{#if:{{{KeyPoint1|}}}|
<h3>Source & Attribution</h3>
<div class="keypoints-float">
{{#if:{{{Translator|}}}|<p><strong>Translator:</strong> {{{Translator}}}</p>}}
<div class="keypoints-header">📌 Key Points</div>
{{#if:{{{Source|}}}|<p><strong>Original Source:</strong> {{{Source}}}</p>}}
<ul class="keypoints-list">
{{#if:{{{KeyPoint1|}}}|<li>{{{KeyPoint1|}}}</li>|}}
{{#if:{{{KeyPoint2|}}}|<li>{{{KeyPoint2|}}}</li>|}}
{{#if:{{{KeyPoint3|}}}|<li>{{{KeyPoint3|}}}</li>|}}
{{#if:{{{KeyPoint4|}}}|<li>{{{KeyPoint4|}}}</li>|}}
</ul>
</div>
</div>
|}}
<!-- Sidebar Widget with Related Articles -->
{{#if:{{{Category|}}}|<div class="sidebar-related">
<div class="sidebar-related-title">🔗 Latest in {{{Category|}}}</div>
<ul>
{{#ask:
[[Category:{{{Category|}}}]]
[[!{{FULLPAGENAME}}]]
[[Date::+]]
|?DisplayTitle
|sort=Date
|order=desc
|limit=3
|format=template
|template=RelatedArticleRow
|link=none
|headers=hide
|searchlabel=
}}
}}
 
</ul>
{{#if:{{{Author_Bio|}}}|
</div>|}}
<hr class="author-divider">
<div class="article-author-bio">
<h3>About the Author</h3>
{{{Author_Bio}}}
</div>
</div>
}}
{{#if:{{{Category|}}}
| [[Category:{{{Category}}}]]
| [[Category:Uncategorized Articles]]
}}
</div>
</div>
 
<!-- Categories -->
 
[[Category:{{{Category|}}}]]
[[Category:Articles]]
{{#if:{{{Language|}}}|[[Category:{{{Language}}} articles]]|}}
{{#if:{{{OriginalAuthor|}}}|
[[Category:Translations]]
[[Category:Translated by {{{Author|}}}]]
|[[Category:Articles by {{{Author|}}}]]}}
</includeonly>
<noinclude>
<noinclude>
<templatedata>
== Article Template ==
{
This template renders article pages with proper layout and styling.
"description": "Structured article layout template",
[[Category:Templates]]
"params": {
{{DEFAULTSORT:{{{DisplayTitle|{{{Title|}}}}}}}}
"Display_Name": {
"label": "Display Name",
"description": "Title shown on the page",
"type": "string",
"required": true
},
"Author": { "label": "Author", "type": "string" },
"Date": { "label": "Date", "type": "date" },
"Intro": { "label": "Introduction", "type": "string", "multiline": true },
"Thumbnail": { "label": "Thumbnail Image", "type": "wiki-file-name" },
"Thumbnail_Caption": { "label": "Thumbnail Caption", "type": "string" },
"Image1": { "label": "Main Image", "type": "wiki-file-name" },
"Image1_Caption": { "label": "Image Caption", "type": "string" },
"Highlight1": { "label": "Highlight 1", "type": "string" },
"Highlight2": { "label": "Highlight 2", "type": "string" },
"Content": {
"label": "Article Content",
"type": "string",
"multiline": true,
"required": true
},
"Author_Bio": { "label": "About the Author", "type": "string", "multiline": true },
"Category": { "label": "Category", "type": "string" }
}
}
</templatedata>
</noinclude>
</noinclude>

Latest revision as of 16:04, 2 May 2026


Article Template

This template renders article pages with proper layout and styling.