User talk:Alex 21
|
||||||||||||
|
Coding question, if you may know
[edit]Hey Alex. When using conditional parser functions (such as {{#:if}}) is there a good way to include line breaks returns in the true/false sections, particularly if you're trying to have the parameters return wikitable code that relies on such breaks? I've read that the parser functions strip the new lines so I tried using br tags in something I'm working, which seemed to be largely ok. However, I came across an issue that said br tag was being considered as an additional list item for a cell adding unintended white space. Thanks for any insight. - Favre1fan93 (talk) 00:17, 6 February 2025 (UTC)
- Yep! Don't use the parser function, use the equivalent template, so {{if}}, as it does not strip spaces and newlines. Here's an example:
{{If||x|a b c || d e f}}
And it produces: a
b
c
- Let me know if that works! -- Alex_21 TALK 01:51, 6 February 2025 (UTC)
- I can't seem to get that template to function as I intend to. I seem to have followed your example. This is what I'm looking for it to render:
{{If||{{{1|}}}|<!-- True --> {{!-}} {{!}} scope="row" style="text-align:right; border-style: dotted; padding-left:20px;" {{!}} {{{year|}}} {{!}} style="background:#000000; text-align:right; border:1px solid white;" {{!}} {{!}} style="border:none; padding-right:20px;" {{!}} {{{1|}}} | <!-- Else -->}}
- It doesn't seem to be hitting the true part. - Favre1fan93 (talk) 19:58, 6 February 2025 (UTC)
- The specific error I'm trying to solve can be seen in my sandbox User:Favre1fan93/sandbox/9 with the row for Your Friendly Neighborhood Spider-Man, which is using {{Indented plainlist}} and is causing an additional break to be added to that cell. Each row of the template is being generated from code in User:Favre1fan93/sandbox/8, which is where I was wondering if switching to {{if}} would help me. - Favre1fan93 (talk) 20:27, 6 February 2025 (UTC)
- Well, in User:Favre1fan93/sandbox/8, TRUE only runs if
|break=
is set, right? There doesn't seem to be any such parameter in User:Favre1fan93/sandbox/9. Wouldn't the line break be coming from the line beneath the{{#if:{{{4_multiverse|}}} |
line in sandbox 8? -- Alex_21 TALK 03:35, 7 February 2025 (UTC)- I spent a good amount of time yesterday looking at this and switching my code from the parser to the template, and yes, in the specific instance of
|break=
and that portion of the code (which for ease I just replicated above with|1=
), even if I called that parameter and set a value to it, the "TRUE" code would not run. I would expect the table code to just return as text, but that's not happening. I'm just getting nothing. The line break in question is with this: {{#if:{{{5|}}} |<br /> (I've bolded the break), which is just below the building of the fourth row of the group, should it exist. I think the template if would work if I could make it do what it should, but I can't seem to. I also have realized this code may be similar to what you did years ago with {{Series overview/row}} before it was made a module, or that this whole thing is likely much better as a module, but I don't have the Lua knowledge set to make that happen so I'm trying to go forward with wikicode. - Favre1fan93 (talk) 16:09, 7 February 2025 (UTC)- I'm the worst at responding... Just confirming it's all working at {{Marvel Cinematic Universe timeline}} now? -- Alex_21 TALK 06:41, 12 February 2025 (UTC)
- I spent a good amount of time yesterday looking at this and switching my code from the parser to the template, and yes, in the specific instance of
- Well, in User:Favre1fan93/sandbox/8, TRUE only runs if
I don't know if you follow You, but I don't remember if Kate Galvin formally reverts to her original surname Lockwood as that IP claimed while editing You season 5. I found this which says, "If you're looking for the core of Kate Lockwood, that's it." So should the name be changed at s5 and the characters list? Kailash29792 (talk) 03:14, 18 February 2025 (UTC)