Template talk:To do: Difference between revisions
m Archiving 2 discussion(s) to Template talk:To do/Archive 1) (bot |
→Template source not showing correctly: new section |
||
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">{{U|[[User:Technical 13|Technical 13]]}} <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">{{U|[[User:Technical 13|Technical 13]]}} <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|| 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
Priority 9
|
This page has archives. Sections older than 366 days may be automatically archived by Lowercase sigmabot III when more than 1 section is present. |
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)
![]() | |
---|---|
* List element 1
|
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)
![]() | |
---|---|
|
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)
- To see the status of this issue, here is the same example again, but this time it has not been substituted:
To-do list for Template:To do:
- List element 1
- List element 2
- 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>
- I expect that someone will test both ideas in the sandbox, and will apply the better of the two options (I'm quite busy in RL atm or I would do it myself. Happy editing! Technical 13 (talk) 12:50, 10 May 2013 (UTC)
- Kri, did this ever get resolved for you? — {{U|Technical 13}} (e • t • c) 04:22, 11 December 2014 (UTC)
Template-protected edit request on 10 December 2014
This edit request has been answered. Set the |answered=
or|ans=
parameter to no to reactivate your request.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}} (e • t • c) 19:39, 10 December 2014 (UTC)
Done. ☠ Jaguar ☠ 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
tr
andtd
tags are in the source (caused by$wgUseTidy
) instead of the wiki markup. The template won´t work in such way, astr/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|| for {{{for|[[:{{{target|{{SUBJECTPAGENAME}}}}}]]}}} }}:</th><td class="mbox-empty-cell"></td></tr>{{ #if: {{{above|}}} | <tr class="todo-abovebelow"><td colspan="2">{{{above}}}</td></tr> }} |-