Template talk:Issue Images

So the breakdown of the title is in two parts, and both parts use the #explode: function.

Explode works like this:

"How now Brown Cow" is the part you want to split up into smaller parts. "Brown" is the place where you want the part to be split at. "1" is the section you want returned. "0" or not specified in 1's position would return everything before "Brown", where as the way it's stated above will return " Cow". Spaces before and after any section are ignored because spaces are special characters.

So to use this in the title, we need to know a couple things. #1, what is ALWAYS in the title. (Vol and Spaces). #2 What separates the title from the volume number, and the volume number from the issue number. (Vol in the first case, and spaces in the second). From there, it becomes a simple matter of splitting the title into sections:

or returns the same thing: "Title"

and

gives us: "Volume Issue",

so to split these two parts further, we need to explode (split) around the space:

or returns: "Volume"

returns: "Issue"

Note two things. #1, having one space in the "what to split around" part is the only place a space is recognized for this function. #2, We've nested the two functions, so we are essentially performing the second split (around the space) on the part we've already split (around the 'Vol').

So there's how I split up the title. I've done similar things for the Character's titles, pulling out the Universe field when it exists. (Which doesn't always work because there could be multiple parts inside parenthesis in the title, and there's no way to really know for sure that there are one or multiple).

To do what you'd like, having only the title in italics, you'd have to try to explode out the title only from any input you put into the Template you're doing it in. Cnst looks for 'Vol' in the input, and if it isn't there, assumes it's a Vol 1, and looks for a '#' to put the Vol 1 into. If there's no 'Vol' and no '#' then it just returns what it was given as with and  around it. So for yours, you'd need to know what you and other users of the template will ALWAYS be putting into the input.

And now you see what is the hardest part about template creation, anticipating what the user will put into the template. This is always super hard because most people don't even look at the documentation for the template, but just put in what they 'think' should go there, or what goes there based on how the template has been filled out in the past.

Whew!

&mdash; Nathan (Peteparker) (Earth-1218) (talk &bull; contribs &bull; email) 15:51, 12 November 2008 (UTC)