User blog:Rupuzioks/Nested parser funtions

Hello,, here is the explanation of some crazy nested parser functions for the template.

1. First comes the substitution part. 2. Next you need to replace ' apostrophe in names, since substituting the name, the symbol is shown as html code. part to replace &amp;#39; 3. Here is the hard part, you need to figure out the length of the name before the suffix, such as " (Legends)". start 0 For example, "Joyous Seer of Julianos (Dwynnen)" has 23 characters, but you need that the template calculate this automatically. 4. The template can calculate it by using #pos parser function. search term ( It can calculate the length up to a specific character, in this case the "(" left parenthesis. 5. But there is a space between the end of the name and the suffix, so you can substract it by using #expr parser function.

It is "-1", since there is only one space between the end of the name and the suffix. 6. Since now you can calculate it automatically, you can combine it into the main syntax. start 0 0 7. You will need the opposite (the suffix) too later, so you can invert the start and length to calculate it. But the suffix is needed alone without the space before it, so you don't need to substract from the calculated length. start 24 ( 8. Now the part to tell the template if the name has the suffix or not. You can use #ifeq parser function. string 2 string 2 You can use the "name suffix" method, so if there is no suffix, the comparison will be different. &amp;#39; Second string can be the default full article name without any other syntax. string 2 If the name has a suffix, the strings will be identical, and the template will use the syntax with calculated name length without suffix. string 2 If the name does not have a suffix, then the strings will be different, and the template will use the syntax for the default full article name without any other syntax. 9. So the full syntax looks like this. &amp;#39; Since you can't use it like this directly in the template, you need to convert it, so it won't substitute the syntax in the template. subst: to