Merge code into Navbox template

edit

Shouldn't navbox just do this automatically? This should therefore be merged into the default code at Navbox. Rgrds. --64.85.217.93 (talk) 13:28, 10 April 2013 (UTC)Reply

Live template broken?

edit

Since Andrybak thanked me for creating them (*hattip* Guv'na.), I figure I should actually bring up why I've created both testcases for this template, and a sandbox version for which one of those two testcases fails.

AFAICT, Neveselbert's most recent edit to the live template source broke its inclusion of default style parameters. You can see, in fact, that the default style parameters line-height:1.2em; padding:.1em 0; are currently appearing in the template's output @ Template:longitem. When transcluded, they're simply absent, so the template is currently applying no styling when used without a |style= parameter except for display: inline-block (See the testcases, which use |_showcode=yes to display the resultant HTML from the transclusions.)

I will be perfectly honest, I could not make heads or tails of the conditional used in the most recent edit, so I am unable to say whether my sandbox version is equivalent to its intent. I haven't the foggiest clue what its intent was, as the code is completely beyond me.

IF the intent was that the template apply the complete set of styles, display:inline-block; line-height:1.2em; padding:.1em 0; unless a |style= parameter is passed, in which case display:inline-block; is combined with the arguments to the |style= parameter, then my sandbox version accomplishes that. (Again, see testcases.) If there was some additional / more complex goal beyond that, then my version is probably lacking due to me not understanding the assignment.

Neveselbert, do you think you could look at {{longitem}} again, and either apply my sandbox version or some other fix? The last edit definitely didn't go as planned, given that the template is currently almost completely non-functional. AdvThanksance! FeRDNYC (talk) 07:59, 26 September 2022 (UTC)Reply

Sorry for the inconvenience FeRDNYC, I made the change to fix another issue described at Messed up infobox - Congress of Tamaulipas. I'm going to troubleshoot the problem now and should be able to fix it in a short while. ‑‑Neveselbert (talk · contribs · email) 01:22, 27 September 2022 (UTC)Reply
I think the issue should be fixed now, I've checked the testcases (thanks for creating them). ‑‑Neveselbert (talk · contribs · email) 01:28, 27 September 2022 (UTC)Reply
Thanks Neveselbert, looks good to me! I've added a link to the tracking category in the documentation. FeRDNYC (talk) 09:20, 27 September 2022 (UTC)Reply

Template-protected edit request on 6 May 2023 (Simplify the template)

edit

Currently the way we are implementing this template is very (very) complicated and requires un-necessary comparisms between the same variables For example: {{{1|+}}} is compared with {{{1|-}}} multiple times. We could probably slim the template down to the following.

<div style="display: inline-block; line-height: 1.2em; padding: .1em 0;{{{style|<includeonly>width: 100%;</includeonly>}}}">{{{1|}}}</div><includeonly>{{#if:{{{2|}}}|[[Category:Pages using Template:Longitem with unnamed style parameter]]}}</includeonly><noinclude>
{{documentation}}
</noinclude>

I've made the changes to the sandbox in case we need to check specific situations/edge cases where there may be issues. Lmk if there are any issues. Sohom Datta (talk) 02:47, 6 May 2023 (UTC)Reply

Ping @MJL since this came up on their stream :) Sohom Datta (talk) 02:50, 6 May 2023 (UTC)Reply
I didn't test this out, but assuming it's not breaking anything then we should probably accept the change.
@Neveselbert: might be able to explain how/why the current code works the way it does. –MJLTalk 03:52, 6 May 2023 (UTC)Reply
I did play around with some testcases right now and the only difference is the behaviour with a missing 1= parameter. In case that specific example is important, we can do the following:
<div style="display: inline-block; line-height: 1.2em; padding: .1em 0;{{{style|<includeonly>width: 100%;</includeonly>}}}">{{{1|Missing <code>1=</code> parameter}}}</div><includeonly>{{#if:{{{2|}}}|[[Category:Pages using Template:Longitem with unnamed style parameter]]}}</includeonly><noinclude>{{documentation}}</noinclude>
and still have a similar simplified version. :) Sohom Datta (talk) 04:10, 6 May 2023 (UTC)Reply
Hi all, I'm afraid the {{{1|+}}} is necessary to prevent issues arising in {{Infobox legislature}}. Also, there is no need to include Missing <code>1=</code> parameter inside {{{1|}}} as the template is used without parameters to provide styling for |item_style= in {{unbulleted list}}. I'll see if I can implement some of the other changes after testing in the sandbox. ‑‑Neveselbert (talk · contribs · email) 17:25, 6 May 2023 (UTC)Reply