Community Central
Community Central
Forums: Index Help desk Space at end of if statement
Fandom's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
Archive
Note: This topic has been unedited for 6396 days. It is considered archived - the discussion is over. Information in this thread may be out of date. Do not add to unless it really needs a response.


In w:c:ChristianMusic:Template:Box Set Link Builder#Multiple Numbered Volumes, Multiple Numbered Discs, No Track, please examine the last sample (at the bottom of the page). Could someone explain how to get spaces in between "of" and "Volume"? The template includes "{{#if: {{{4|}}}|Disc {{#if: {{{Discs Are Named|}}}|''{{{4}}}''|{{{4}}}}} of }}". Notice the space just before the final closing braces. That space is apperantly being trimmed by #if:.

Is there a way to prevent that from happening? I do not want to put the space on the other side of those braces as it might be visible when the text it should be with is ommitted. I also do want to avoid resorting to &nbsp; as that would cause odd formatting problems. Will (talk -- contribs) 20:06, 8 October 2006 (UTC) Use <nowiki> tags to do that:

|<nowiki>{{{4}}}}} of </nowiki>}}

Dantman (Talk) 23:19, 8 October 2006 (UTC)

First, I did not know you could use nowiki to keep the #if from trimming the spaces. Second, what is to prevent the way you had it above from causing the {{{4}}} from failing to expand. Shouldn't the nowiki tag be on the other side of the parameter?
Third, from what I can tell, w:c:User:StBacchus made a change. That change looks like it is having the desired effect, but instead of your nowiki solution, the change implemented was to put the space outside the #if:. This could cause other problems with formatting and I am thinking of changing it back. Will (talk -- contribs) 04:34, 9 October 2006 (UTC)
Could also try   or  . --Splarka (talk) 04:41, 9 October 2006 (UTC)

I specifically do not want &nbsp;. I stated that above. I will not repeat this again. I have no idea what &emsp; is. Will (talk -- contribs) 05:21, 9 October 2006 (UTC)

Um... &emsp; is a breaking space. --Splarka (talk) 05:35, 9 October 2006 (UTC)

That helps. When I searched Meta, all I found was a list of page using that code. That did not help. I will try the &emsp;. Thank you. Will (talk -- contribs) 23:57, 9 October 2006 (UTC)

&emsp; made the spaces too wide. Even with just one space of any type in there, I got a double width space. I am not see any problems with "<nowiki> </nowiki>".
New problem. Why does the sample at the top of the page have so many italtic marks? I am concerned that I may get unintended formatting as a result of that. Will (talk -- contribs) 00:07, 10 October 2006 (UTC)
Sorry... I made a quick mistake in the placement of the nowiki tag. This is what that section of code you are talking about looks like when you break it down into structure.
{{#if: {{{3|}}}
	|/{{#if: {{{Volumes Are Named|}}}
		|
		|v
	}}
	{{{3}}}
	|---(|)---|
}}
{{#if: {{{4|}}}
	|/{{#if: {{{Discs Are Named|}}}
		|
		|d
	}}
	{{{4}}}
	|---(|)---|
}}
{{#if: {{{5|}}}
	|/{{{5}}}
	|---(|)---|
}}
|{{#if: {{{5|}}}   <---
	|''{{{5}}}''
	|{{#if: {{{Show Explicit Label|}}}   <---
		|{{#if: {{{4|}}}
			|Disc {{#if: {{{Discs Are Named|}}}
				|''{{{4}}}''
				|{{{4}}}
			}} of<nowiki> 
			|---(|)---|
		}}
		{{#if: {{{3|}}}
			|Volume {{#if: {{{Volumes Are Named|}}}
				|''{{{3}}}''
				|{{{3}}}
			}} of 
			|---(|)---|
		}}
		{{{1}}}'s box set ''{{{2}}}''
		|{{#if: {{{4|}}}   <---
			|{{#if: {{{Show Label|}}}
				|Disc 
				|---(|)---|
			}}
			{{#if:{{{Discs Are Named|}}}
				|''{{{4}}}''
				|{{{4}}}
			}}
			|{{#if:{{{3|}}}   <---
				|{{#if: {{{Show Label|}}}
					|Volume 
					|---(|)---|
				}}
				{{#if: {{{Volumes Are Named|}}}
					|''{{{3}}}''
					|{{{3}}}
				}}
				|''{{{2}}}''   <---*
			}}
		}}
	}}
}}
]]
{{#if: {{{5|}}}
	|&#9835;
	|{{#if: {{{4|}}}
		|[[Image:System^Link Label^Disc.png]]
		|{{#if: {{{3|}}}
			|[[Image:System^Link Label^Volume.png]]
			|[[Image:System^Link Label^Box.png]]
		}}
	}}
}}</nowiki>

The first thing I'm going to note is that 7 of the sections are missing the then portion which may cause issues. These sections are marked with |---(|)---|.

I have marked the points in which the parser would track through the code with <--- and added a * on the line where we end up at. Since this line looks normal it is my beleif that this may be caused by impropper coding.

Dantman (Talk) 05:47, 10 October 2006 (UTC)

I am not following you. Are you talking about the problem with the space -- or the extra italics? Will (talk -- contribs) 15:06, 10 October 2006 (UTC)
I fixed the syntax but it didn't work. Now your code is just typed right. Dantman (Talk) 02:22, 12 October 2006 (UTC)

The only change I have found is that the {{{Volumes Are Named}}} parameter is now named {{{Volumes Are named}}}. The old name was the design name. Why change it? There may not be any uses of this parameter in the samples, but it is refered to in the documentation at the bottom. It is also passed by {{Box Set Volume Cell}} in case it is passed to {{Box Set Indexer}}. I could not find any other locations where your version of the parameter was referenced. So I am changing it back.

That change you made could be considered vandalism under the strictist definition. For now, I will overlook that. Will (talk -- contribs) 01:35, 13 October 2006 (UTC)

I don't remember changing a variable. All I remember is fixing the problem where you were missing then sections of if statements. And there are no missing then statements anymore. So I have a feeling that someone vandalized the page after I made the change.

Anyways. I looked through the thing. Aparently it has a dislike of having the sections stuck together the way it was. The only time it didn't come up with that glitch was when I tested a code similar to what I typed above where whitespace makes the structure. So it apears that the extra quote marks are a side-effect of not seperating sections with whitespace. I've went through the code and added a space inside of the if sections ("{{#if {{{something|}}}|this|that}}" is now "{{#if {{{something|}}} | this | that}}". Since I have only added whitespace inside of the start and end of if sections those spaces will be trimmed and the output will remain the same (If something glitched, tell me and I'll try and find what spot I messed up on.) But the good news is that the quotemarks are gone. Dantman (Talk) 06:07, 13 October 2006 (UTC)

Nevermind. I see what happened. A finger must have slipped up when I was finding the sections to fix and deleted something, I must have tryed to type it back but forgot a capitalization. Sorry. Dantman (Talk) 06:12, 13 October 2006 (UTC)

The version of the template at the top (with no parameters passed) does show spaces beside the link text and does not italicize the link text. Granted the template will never be called like this, but I still would have expected the spaces to be gone and the link text to be italicized. Will (talk -- contribs) 18:55, 13 October 2006 (UTC)
I didn't add spaces in those areas so I don't know why they are there but the spaces may be a side effect of the blank call. But anyways, spaces are striped in wikitext so when that is outputed the whitespace should not show up and the italics should work. Dantman (Talk) 07:45, 14 October 2006 (UTC)