Jump to content

Template talk:To do: Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
m Archiving 2 discussion(s) to Template talk:To do/Archive 1) (bot
Escalatr (talk | contribs)
Line 207: Line 207:
Please update this template using the {{ComparePages|Template:To do|637511799|changes in the sandbox}} to make the template code easier to read and be [[WP:HTML5|HTML5]] compliant. Thank you. — <span class="nowrap">&#123;&#123;U&#124;[[User:Technical 13|Technical 13]]&#125;&#125; <sup>([[Special:EmailUser/Technical 13|e]] • [[User talk:Technical 13|t]] • [[Special:Contribs/Technical 13|c]])</sup></span> 19:39, 10 December 2014 (UTC)
Please update this template using the {{ComparePages|Template:To do|637511799|changes in the sandbox}} to make the template code easier to read and be [[WP:HTML5|HTML5]] compliant. Thank you. — <span class="nowrap">&#123;&#123;U&#124;[[User:Technical 13|Technical 13]]&#125;&#125; <sup>([[Special:EmailUser/Technical 13|e]] • [[User talk:Technical 13|t]] • [[Special:Contribs/Technical 13|c]])</sup></span> 19:39, 10 December 2014 (UTC)
:{{done}}. '''☠''' [[User:Jaguar|<font color="black">'''Jag'''</font>]][[User talk:Jaguar|<font color="black">'''uar'''</font>]] '''☠''' 19:16, 14 December 2014 (UTC)
:{{done}}. '''☠''' [[User:Jaguar|<font color="black">'''Jag'''</font>]][[User talk:Jaguar|<font color="black">'''uar'''</font>]] '''☠''' 19:16, 14 December 2014 (UTC)

== Template source not showing correctly ==

Just a minor issue: when you try to import this template onto another wiki, some <code>tr</code> and <code>td</code> tags are in the source (caused by <code>$wgUseTidy</code>) instead of the wiki markup. The template won´t work in such way, as <code>tr/td</code> tags are forbidden by default. [https://www.mediawiki.org/wiki/Help_talk:Templates#Source_code_of_the_page_has_.26lt.3Btr.26gt.3B.26lt.3Bth.26gt.3B_instead_.3Ctr.3E.3Cth.3E] I would say a note about this issue somewhere on doc page would be helpful for other users.

<syntaxhighlight lang="html" highlight="2,6,7">
{| class="{{Talk other|demospace={{{demospace|}}}|tmbox tmbox-notice|ombox ombox-notice}} {{#ifeq:{{{small|}}}|yes|mbox-small}} {{#ifeq:{{{collapsed|}}}|yes|collapsible collapsed}} t-todo" style="border-collapse: separate; border-spacing: 4px; {{{style|}}}"
<tr><th class="mbox-text" style="text-align: left; padding: 1px;">{{
#if: {{{inner|}}}
[...]
#ifeq: {{#ifeq:{{{smallfor|}}}|yes|no|{{{small|}}}}}|yes||&#32;for {{{for|[[:{{{target|{{SUBJECTPAGENAME}}}}}]]}}}
}}:</th><td class="mbox-empty-cell"></td></tr>{{
#if: {{{above|}}} | <tr class="todo-abovebelow"><td colspan="2">{{{above}}}</td></tr>
}}
|-
</syntaxhighlight>

Revision as of 11:28, 3 August 2015

Problem with lists in the inner argument

There is a problem with having lists in the inner argument. If one writes

{{To do
|inner=
* List element 1
* List element 2
}}

the result becomes (the to do template has been substituted in this example)

To-do list for Template:To do:
* List element 1
  • List element 2

which is incorrect behavior. However, if one instead encloses the inner argument in an HTML <span>:

{{To do
|inner=<span>
* List element 1
* List element 2
</span>
}}

the result instead becomes (the to do template has been substituted in this example)

To-do list for Template:To do:
  • List element 1
  • List element 2

which is the correct behavior. The same incorrect behavior exists for numbered lists in the inner argument and has the same remedy. —Kri (talk) 09:01, 7 June 2012 (UTC)[reply]

To see the status of this issue, here is the same example again, but this time it has not been substituted:
Kri (talk) 15:47, 7 July 2012 (UTC)[reply]
  • I've actually dealt with this problem quite a bit on another wiki. There are three possible solutions.
1. Change the following code:
    #if: {{{inner|}}} | | {{
      #ifexist: {{#rel2abs:{{{list|./to do}}}|{{{target|}}}}} | | {{#switch:{{NAMESPACE}}
  • To this code simply moving the placement of the linefeed in the template:
    #if: {{{inner|}}} | |
      {{#ifexist: {{#rel2abs:{{{list|./to do}}}|{{{target|}}}}} | | {{#switch:{{NAMESPACE}}
2. Change the same code :
    #if: {{{inner|}}} | | {{
      #ifexist: {{#rel2abs:{{{list|./to do}}}|{{{target|}}}}} | | {{#switch:{{NAMESPACE}}
  • To include a line break inside the template:
    #if: {{{inner|}}} | | <br />{{
      #ifexist: {{#rel2abs:{{{list|./to do}}}|{{{target|}}}}} | | {{#switch:{{NAMESPACE}}
3. Change a larger chunk of code :
<includeonly>{{
  #ifeq: {{{nocats}}} | yes | | {{{category|[[Category:Wikipedia pages with to-do lists|{{PAGENAME}}]]}}}{{
    #if: {{{inner|}}} | | {{
      #ifexist: {{#rel2abs:{{{list|./to do}}}|{{{target|}}}}} | | {{#switch:{{NAMESPACE}}
       |{{ns:2}}
       |{{ns:3}}=
       |#default=[[Category:Wikipedia pages with to-do lists, unused]]
       }}
    }}
  }}
}}</includeonly>
  • To include a span wrapper inside the template:
<includeonly>{{
  #ifeq: {{{nocats}}} | yes | | {{{category|[[Category:Wikipedia pages with to-do lists|{{PAGENAME}}]]}}}{{
    #if: {{{inner|}}} | | <span>{{
      #ifexist: {{#rel2abs:{{{list|./to do}}}|{{{target|}}}}} | | {{#switch:{{NAMESPACE}}
       |{{ns:2}}
       |{{ns:3}}=
       |#default=[[Category:Wikipedia pages with to-do lists, unused]]
       }}
    }}</span>
  }}
}}</includeonly>

Template-protected edit request on 10 December 2014

Please update this template using the changes in the sandbox to make the template code easier to read and be HTML5 compliant. Thank you. — {{U|Technical 13}} (etc) 19:39, 10 December 2014 (UTC)[reply]

 Done. Jaguar 19:16, 14 December 2014 (UTC)[reply]

Template source not showing correctly

Just a minor issue: when you try to import this template onto another wiki, some tr and td tags are in the source (caused by $wgUseTidy) instead of the wiki markup. The template won´t work in such way, as tr/td tags are forbidden by default. [1] I would say a note about this issue somewhere on doc page would be helpful for other users.

{| class="{{Talk other|demospace={{{demospace|}}}|tmbox tmbox-notice|ombox ombox-notice}} {{#ifeq:{{{small|}}}|yes|mbox-small}} {{#ifeq:{{{collapsed|}}}|yes|collapsible collapsed}} t-todo" style="border-collapse: separate; border-spacing: 4px; {{{style|}}}"
<tr><th class="mbox-text" style="text-align: left; padding: 1px;">{{
  #if: {{{inner|}}}
[...]
  #ifeq: {{#ifeq:{{{smallfor|}}}|yes|no|{{{small|}}}}}|yes||&#32;for {{{for|[[:{{{target|{{SUBJECTPAGENAME}}}}}]]}}}
}}:</th><td class="mbox-empty-cell"></td></tr>{{
  #if: {{{above|}}} | <tr class="todo-abovebelow"><td colspan="2">{{{above}}}</td></tr>
}}
|-