Module talk:Sidebar

From Wikipedia, the free encyclopedia
  (Redirected from Template talk:Sidebar/doc)
Jump to: navigation, search

Template-protected edit request on 31 October 2014[edit]

Please replace the cellspacing attribute on the table with an appropriate CSS. There're still some obsolete atributes, including cellspacing. See the error list, thank you in advance! See Template_talk:Infobox#Protected_edit_request_on_30_October_2014 for more info. Rezonansowy (talk | contribs) 21:17, 31 October 2014 (UTC)

@Mr. Stradivarius: Could you fix this, please? --Rezonansowy (talk | contribs) 11:32, 11 November 2014 (UTC)
There are two obsolete attributes:
  • .attr('cellspacing', args.cellspacing or 5)
  • .attr('cellpadding', args.cellpadding or 0
--  Gadget850 talk 15:16, 14 November 2014 (UTC)
Note that any CSS should go in Common.css (if not already there); generic inline CSS should be avoided. -- [[User:Edokter]] {{talk}} 15:42, 14 November 2014 (UTC)
@Gadget850 and Edokter: Should we implement this same like in Template:Infobox? --Rezonansowy (talk | contribs) 16:10, 14 November 2014 (UTC)
I have a similar request at Template talk:Navbox#HTML. I would like to understand what Edokter is proposing. I have noted some similar fixes, but if we should be doing this differently... --  Gadget850 talk 18:24, 14 November 2014 (UTC)
The obsolete attributes do not need replacing per se; they were there to support older browsers. I think the necessary CSS is already in place. The only thing I wanted to point out is that the removed attributes should not be replaced by inline CSS. -- [[User:Edokter]] {{talk}} 19:00, 14 November 2014 (UTC)
Which older browsers? I believe support for older versions of IE has been dropped in MediaWiki recently. --  Gadget850 talk 19:10, 14 November 2014 (UTC)
Probably IE6/7 that did not understand 'advanced' table CSS. We didn't necessarily 'drop support'; we did disable JavaScript for these browsers. But that is pretty much the same... -- [[User:Edokter]] {{talk}} 19:42, 14 November 2014 (UTC)
We shouldn't implement this obsolete tags, since Wikipedia switched to HTML5, some tags are obsolete and incorrect. See our discussion on Village pump. We're going to fix this. --Rezonansowy (talk | contribs) 22:47, 14 November 2014 (UTC)
Just had a look... all CSS is inline! That should be remedied soon. In the mean time, I've removed the obsolete attributes. -- [[User:Edokter]] {{talk}} 19:47, 14 November 2014 (UTC)
@Edokter: Note that currently, template editors can change the CSS that this uses. If it were all in common.css, only admins could. I think we'd need to give that some serious consideration before dumping it all into common.css. Jackmcbarn (talk) 21:31, 14 November 2014 (UTC)
That is not much of an argument. It is common practice to put common CSS in Common.css. Module-generated CSS is unmanagable and very hard to test. Inline CSS may also present problems in Mobile, so all in all, inline = bad. -- [[User:Edokter]] {{talk}} 21:40, 14 November 2014 (UTC)
Now that I see how this works (I'm still figuring out Lua), I agree with Edokter. It is not that difficult to get Common.css updated. --  Gadget850 talk 22:13, 14 November 2014 (UTC)

"child" handling[edit]

Hello – could the code be amended, please, so that it can handle {{Sidebar |child as {{Navbox}} handles {{Navbox |child?
I suspect a line such as border = trim(args.border or args[1] or '') (from Module:Navbox) will be needed somewhere, but, in lieu-a of learning Lua, that's about as far as my guessing extends.
Sardanaphalus (talk) 12:31, 13 January 2015 (UTC)

PS The same modification for {{Infobox}} as well..?

{{infobox}} already does this, with the |child=yes parameter. --Redrose64 (talk) 14:27, 13 January 2015 (UTC)
But can it handle {{Infobox |child ..? Sardanaphalus (talk) 00:26, 14 January 2015 (UTC)
No, it does not support unnamed parameters. -- [[User:Edokter]] {{talk}} 01:14, 14 January 2015 (UTC)

contentNclass[edit]

There's content1style, content2style etc, but not, so far as I can see, content1class, content2class, etc. Since, for example, the lists supplied as a Sidebar's contents are not necessarily all "hlist" or all "plainlist" in nature, could these parameters be included, please? Sardanaphalus (talk) 10:40, 18 January 2015 (UTC)
(i.e. so code such as below left rather than below right may be used:)

   {{Sidebar
   | name = ......
   | class = plainlist

   ............

   | heading1 = ......
   | content1class = hlist
   | content1 = ......

   | heading2 = ......
   | content2 = ......

   | heading3 = ......
   | content3 = ......

   | heading4 = ......
   | content4class = hlist
   | content4 = ......

   | heading5 = ......
   | content5 = ......

   (etc)

   }}
   
  {{Sidebar
  | name = ......
  | class = plainlist

  ............

  | heading1 = ......
  | content1 = {{startflatlist}}
  ......
  {{endflatlist}}

  | heading2 = ......
  | content2 = ......

  | heading3 = ......
  | content3 = ......

  | heading4 = ......
  | content4 = {{startflatlist}}
  ......
  {{endflatlist}}

  | heading5 = ......
  | content5 = ......

  (etc)

  }}

   
  • I've just realised that listNclass is available for {{Sidebar with collapsible lists}}, yet, as above, the corresponding contentNclass doesn't appear to be available for {{Sidebar}}. Can the latter be tweaked accordingly, please..? Sardanaphalus (talk) 23:21, 26 January 2015 (UTC)

header padding is inconsistent[edit]

See the Discrimination sidebar at Genocide for example. The first header is noticeably smaller than the second header, at least in regard to the part that is colored. Could someone fix this? Kaldari (talk) 18:40, 29 April 2016 (UTC)

Kaldari, the problem is that one is a collapsible list title and the other is a header. the collapsible list titles have an inner collapsible div which includes the colouring, where the headers just use standard table headers. I added a hack to correct for the difference, but it would be better if the collapsible div containers filled the entire table cell. Frietjes (talk) 18:58, 29 April 2016 (UTC)
something like this would also fix it by removing the left/right padding from the table cell container. Frietjes (talk) 19:17, 29 April 2016 (UTC)
Either solution is fine with me. Thanks! Kaldari (talk) 22:11, 29 April 2016 (UTC)