Difference between revisions of "Template:comic discussion/assist"

Explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
(oops)
 
(40 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>__TOC__</noinclude><br><div style="clear: both"></div><span id="Discussion"></span>{{#ifeq:{{FULLPAGENAME}}|{{MediaWiki:mainpage}}|<!-- Don't display anything if this is the main page
+
<noinclude>'''The template {{tl|comic discussion}} has an associated sandbox, available at [[Template:comic discussion/assist]].'''[[Category:Templates]]<br><br>__TOC__</noinclude><br><div style="clear: both"></div><!--
  
STYLING OF BUTTONS    -->|<span style="position: absolute; right:0; padding-top:1.7em; font-size: 105%;"><!--
+
                        Don't display anything if this is the main page
 +
                        --><span id="Discussion"></span>{{#ifeq:{{FULLPAGENAME}}|{{MediaWiki:mainpage}}|<!--
  
 +
STYLING OF BUTTONS    -->|<span style="position: absolute; right:0; padding-top:1.7em; font-size: 105%;"><!--
  
FIRST BUTTON          -->[[File:comment.png|21x21px|link={{fullurl:{{TALKPAGENAME}}|action=edit}}]]<span class="no-link-underline">[{{fullurl:{{TALKPAGENAME}}|action=edit}} &nbsp; </span>'''Add comment''']&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--
+
FIRST BUTTON          -->[[File:comment.png|21x21px|link={{fullurl:{{TALKPAGENAME}}|action=edit}}]]<!--
 +
                        --><span class="no-link-underline">[{{fullurl:{{TALKPAGENAME}}|action=edit}} &nbsp; </span><!--
 +
                        -->'''Add comment''']&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--
  
SECOND BUTTON          -->[[File:new topic.png|21x21px|link={{fullurl:{{TALKPAGENAME}}|action=edit&section=new}}]]<span class="no-link-underline">[{{fullurl:{{TALKPAGENAME}}|action=edit&section=new}} &nbsp; </span>'''Create topic (use sparingly)''']&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--
+
SECOND BUTTON          -->[[File:new topic.png|21x21px|link={{fullurl:{{TALKPAGENAME}}|action=edit&section=new}}]]<!--
 +
                        --><span class="no-link-underline">[{{fullurl:{{TALKPAGENAME}}|action=edit&section=new}} &nbsp; </span><!--
 +
                        -->'''Create topic (use sparingly)''']&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--
  
THIRD BUTTON          -->[[File:refresh discuss.png|21x21px|link={{fullurl:{{FULLPAGENAME}}|action=purge}}]]<span class="no-link-underline">[{{fullurl:{{FULLPAGENAME}}|action=purge}} &nbsp; </span>'''Refresh''']&nbsp;</span><h1>Discussion</h1><!--
+
THIRD BUTTON          -->[[File:refresh discuss.png|21x21px|link={{fullurl:{{FULLPAGENAME}}|action=purge}}]]<!--
 +
                        --><span class="no-link-underline">[{{fullurl:{{FULLPAGENAME}}|action=purge}} &nbsp; </span><!--
 +
                        -->'''Refresh''']&nbsp;</span><h1>Discussion</h1>
 +
<!--This line break is needed for headings.
  
 +
STYLING OF DISCUSSION  --><div class="disctemp" style="border:1px solid grey; background:#f6f6f6; <!--
 +
                        -->padding-top:0.5em; padding-left:1.5em; padding-right:1.5em; padding-bottom:2.5em;">
 +
<!--
  
STYLING OF DISCUSSION --><div class="disctemp" style="border:1px solid grey; background:#f5f5f5; padding:1.5em;"><!--
+
DISCUSSION     -->{{#ifexist:{{TALKPAGENAME}}<!--
  
DISCUSSION            -->{{#ifexist:{{TALKPAGENAME}}
+
                We now know the talk page exists, so we can check if it is empty -->
    |{{#ifeq:{{TALKPAGENAME}}|&lt;!--Please sign your posts with &#126;&#126;&#126;&#126;--&gt;
+
                |{{#if: {{{{TALKPAGENAME}} }}<!--
|''No comments yet, [{{fullurl:{{TALKPAGENAME}}|action=edit}} add the first comment]!''|{{#ifeq:{{TALKPAGENAME}}|<!-- If it's empty, then...
 
  
-->|''No comments yet, [{{fullurl:{{TALKPAGENAME}}|action=edit}} add the first comment]!''|
+
                Ok, there was something there, so transclude it! -->  
{{:{{TALKPAGENAME}}}}}}}}<br><span class="no-link-underline" style="position: absolute; left:0; padding-top:1.3em; padding-bottom:1em; font-size: 105%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[File:comment.png|21x21px|link={{fullurl:{{TALKPAGENAME}}|action=edit}}]][{{fullurl:{{TALKPAGENAME}}|action=edit}} &nbsp; '''Add comment''']</span><br>
+
                |{{{{TALKPAGENAME}} }}<br><!--
  
    |''No comments yet, [{{fullurl:{{TALKPAGENAME}}|action=edit}} add the first comment]!''}}
+
                Now create the ADD COMMENT button at the end
 +
                --><span class="no-link-underline" style="position: absolute; left:0; padding-top:1.3em; font-size: 105%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--
  
</div>__NOTOC__}}<noinclude>[[Category:Templates]]</noinclude>
+
                Start by adding the button image, then add the label
 +
                -->[[File:comment.png|21x21px|link={{fullurl:{{TALKPAGENAME}}|action=edit}}]]<!--
 +
                        -->[{{fullurl:{{TALKPAGENAME}}|action=edit}} &nbsp; '''Add comment''']</span><br><!--
 +
 
 +
                We checked and the talk page existed but was blank, so put default prompt
 +
                -->|<br>''No comments yet, [{{fullurl:{{TALKPAGENAME}}|action=edit}} add the first comment]!''}}<!--
 +
 
 +
                If the talk page didn't exist, put default prompt to create it.
 +
                -->|<br>''No comments yet, [{{fullurl:{{TALKPAGENAME}}|action=edit}} add the first comment]!''}}<!--
 +
 
 +
                We did it, close it up
 +
                --></div>__NOTOC__}}

Latest revision as of 10:02, 27 April 2025

The template {{comic discussion}} has an associated sandbox, available at Template:comic discussion/assist.


comment.png  Add comment      new topic.png  Create topic (use sparingly)     refresh discuss.png  Refresh 

Discussion

This is a test. --FaviFake (talk) 14:21, 25 April 2025 (UTC)

Bug Fix[edit]

This template exists to fix a bug where headers will not render if they're the first thing on the discussion page.

Separate template[edit]

Does this really need its own template?

Nope! I turned it into a sandbox. --FaviFake (talk) 14:21, 25 April 2025 (UTC)
      comment.png  Add comment