Template:Infobox: Difference between revisions

From Drama Chaser
(adding to noinclude about how this works)
(removing redundant name field)
Line 3: Line 3:
The template offers the fields infobox-title, infobox-image, name, age, hometown, sign, and blood type as example fields.   
The template offers the fields infobox-title, infobox-image, name, age, hometown, sign, and blood type as example fields.   


I think the if statement looking for a param1 is simple logic saying that if there's another parameter listed at the end it interprets that as the thing coming up next. But I'm not sure. </noinclude>
I think the if statement looking for a param1 is simple logic saying that if there's another parameter listed at the end it interprets that as the thing coming up next. But I'm not sure.  
 
The name field is redundant in this infobox, because infobox-title is doing that work. so I'm taking that out.
 
</noinclude>
<div class="infobox">
<div class="infobox">
<div class="infobox-title">{{{Title|{{PAGENAME}}}}}</div>{{#if:{{{image|}}}|
<div class="infobox-title">{{{Title|{{PAGENAME}}}}}</div>{{#if:{{{image|}}}|
<div class="infobox-image">[[File:{{PAGENAME:{{{image}}}}}|300px]]</div>}}
<div class="infobox-image">[[File:{{PAGENAME:{{{image}}}}}|300px]]</div>}}
<table class="infobox-table">{{#if:{{{param1|}}}|<tr>
<table class="infobox-table">{{#if:{{{param1|}}}|<tr>
    <th>Name</th>
    <td>{{{name}}}</td>
</tr>}}{{#if:{{{age|}}}|<tr>
     <th>Age</th>
     <th>Age</th>
     <td>{{{age}}}</td>
     <td>{{{age}}}</td>

Revision as of 21:39, 25 April 2024

This is our initial practice infobox template. It should take the page title as its title, it has room for an image, etc.

The template offers the fields infobox-title, infobox-image, name, age, hometown, sign, and blood type as example fields.

I think the if statement looking for a param1 is simple logic saying that if there's another parameter listed at the end it interprets that as the thing coming up next. But I'm not sure.

The name field is redundant in this infobox, because infobox-title is doing that work. so I'm taking that out.


Infobox