Draft:Template:Article: Difference between revisions

From AbhiprayaVedi
No edit summary
No edit summary
Line 1: Line 1:
<includeonly>
<includeonly>
{{DISPLAYTITLE:{{{DisplayTitle|{{{Title|}}}}}}}}
<div class="article-container" data-language="{{{Language|}}}">
<div class="article-container" data-language="{{{Language|}}}">


Line 6: Line 8:
<div class="author-info">
<div class="author-info">
<span class="author-name">{{{Author|}}}</span>
<span class="author-name">{{{Author|}}}</span>
<span class="date-info">{{{Date|}}}</span>
<span class="date-info">{{#time:d-m-Y|{{{Date|}}}}}</span>
<span class="category-badge">{{{Category|}}}</span>
<span class="category-badge">{{{Category|}}}</span>
</div>
</div>
</div>
</div>


<!-- Introduction - Prominent but Compact -->
<!-- Introduction - Compact -->
<div class="introduction-section">
<div class="introduction-section">
{{{Introduction|}}}
{{{Introduction|}}}
Line 73: Line 75:
{{#if:{{{Highlight1|}}}|
{{#if:{{{Highlight1|}}}|
<div class="highlight-box">
<div class="highlight-box">
<div class="highlight-title">പ്രധാനം</div>
<div class="highlight-title">💡</div>
<div class="highlight-text">{{{Highlight1|}}}</div>
<div class="highlight-text">{{{Highlight1|}}}</div>
</div>
</div>
Line 80: Line 82:
{{#if:{{{Highlight2|}}}|
{{#if:{{{Highlight2|}}}|
<div class="highlight-box">
<div class="highlight-box">
<div class="highlight-title">പ്രധാനം</div>
<div class="highlight-title">💡</div>
<div class="highlight-text">{{{Highlight2|}}}</div>
<div class="highlight-text">{{{Highlight2|}}}</div>
</div>
</div>
Line 88: Line 90:
{{#if:{{{KeyPoint1|}}}|
{{#if:{{{KeyPoint1|}}}|
<div class="keypoints-float">
<div class="keypoints-float">
<div class="keypoints-header">പ്രധാന പോയിന്റുകൾ</div>
<div class="keypoints-header">📌</div>
<ul class="keypoints-list">
<ul class="keypoints-list">
{{#if:{{{KeyPoint1|}}}|<li>{{{KeyPoint1|}}}</li>}}
{{#if:{{{KeyPoint1|}}}|<li>{{{KeyPoint1|}}}</li>}}
Line 104: Line 106:
</div>
</div>


<!-- Categories - Bilingual -->
<!-- Categories - Bilingual with DEFAULTSORT for Malayalam display names -->
{{DEFAULTSORT:{{{DisplayTitle|}}}}}
 
[[Category:{{{Category|}}}]]
[[Category:{{{Category|}}}]]
[[Category:Articles]]
[[Category:Articles]]
Line 132: Line 136:


<noinclude>
<noinclude>
{{TemplateData|<nowiki>
== Critical Fix: Display Names in Categories ==
{
  "description": "Modern article template with bilingual category support and refined styling",
  "params": {
    "DisplayTitle": {
      "label": "Display Title",
      "description": "Article title (used for page title, not displayed in header)",
      "type": "string",
      "required": true
    },
    "Language": {
      "label": "Language",
      "description": "Article language",
      "type": "string",
      "required": true,
      "suggestedvalues": ["Malayalam", "English"]
    },
    "Author": {
      "label": "Author",
      "description": "Author name",
      "type": "string",
      "required": true
    },
    "Date": {
      "label": "Date",
      "description": "Publication date",
      "type": "date",
      "required": true
    },
    "Category": {
      "label": "Category",
      "description": "Article category (English name)",
      "type": "string",
      "required": true,
      "suggestedvalues": ["Politics", "Society", "Culture", "Science", "Literature", "Cinema", "Environment", "Economics", "Opinion"]
    },
    "Introduction": {
      "label": "Introduction",
      "description": "Article introduction",
      "type": "content",
      "required": true
    },
    "Content": {
      "label": "Content",
      "description": "Main article content",
      "type": "content",
      "required": true
    },
    "Thumbnail": {
      "label": "Author Photo",
      "description": "Author photo for infobox",
      "type": "wiki-file-name"
    },
    "Image1": {
      "label": "Image 1",
      "description": "First content image",
      "type": "wiki-file-name"
    },
    "Image1Caption": {
      "label": "Image 1 Caption",
      "type": "string"
    },
    "Image2": {
      "label": "Image 2",
      "description": "Second content image",
      "type": "wiki-file-name"
    },
    "Image2Caption": {
      "label": "Image 2 Caption",
      "type": "string"
    },
    "KeyPoint1": {"label": "Key Point 1", "type": "string"},
    "KeyPoint2": {"label": "Key Point 2", "type": "string"},
    "KeyPoint3": {"label": "Key Point 3", "type": "string"},
    "KeyPoint4": {"label": "Key Point 4", "type": "string"},
    "Highlight1": {"label": "Highlight 1", "type": "content"},
    "Highlight2": {"label": "Highlight 2", "type": "content"},
    "OriginalAuthor": {"label": "Original Author", "type": "string"},
    "SourceName": {"label": "Source Name", "type": "string"},
    "SourceURL": {"label": "Source URL", "type": "url"},
    "Author_Bio": {"label": "Author Bio", "type": "content"}
  }
}
</nowiki>}}


== How to Edit Key Points Position ==
The `{{DEFAULTSORT:{{{DisplayTitle|}}}}}` line makes categories show the **Display Title** instead of the page name!
 
Key points appear as a floating box in the right sidebar. To move them elsewhere:
 
1. In the template code, find the section:
<pre>
<!-- Key Points as Floating Box -->
{{#if:{{{KeyPoint1|}}}|
<div class="keypoints-float">
...
</div>
|}}
</pre>


2. Cut this entire section
**How it works:**
- Page name: `Something-In-The-Air`
- Display title: `Something in the Air?`
- Category shows: **"Something in the Air?"** ✓


3. Paste it in one of these locations:
For Malayalam:
* **Top of main content**: After `<div class="main-content">`
- Page name: `Kerala-Climate-Change`
* **Within article text**: After `<div class="article-text">`
- Display title: `കേരളത്തിലെ കാലാവസ്ഥാ വ്യതിയാനം`
* **Bottom of main content**: Before `</div>` that closes main-content
- Category shows: **"കേരളത്തിലെ കാലാവസ്ഥാ വ്യതിയാനം"**


The CSS handles the floating automatically.
This single line fixes the category display issue!


[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>

Revision as of 19:27, 3 April 2026


Critical Fix: Display Names in Categories

The `` line makes categories show the **Display Title** instead of the page name!

    • How it works:**

- Page name: `Something-In-The-Air` - Display title: `Something in the Air?` - Category shows: **"Something in the Air?"** ✓

For Malayalam: - Page name: `Kerala-Climate-Change` - Display title: `കേരളത്തിലെ കാലാവസ്ഥാ വ്യതിയാനം` - Category shows: **"കേരളത്തിലെ കാലാവസ്ഥാ വ്യതിയാനം"** ✓

This single line fixes the category display issue!