Forum:Template problem

From Traveller Wiki - Science-Fiction Adventure in the Far future
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Forums: Index > Watercooler > Template problem



There seems to a problem with Template:InfoboxSubsectorSimple. If you look at the Special Page Wanted Templates, the top one on the list is Template:Alg, if you look at the list of pages asking for it, they all seem to be pages using the Template:InfoboxSubsectorSimple. All the pages have an extra '}' at the beginning of the page, which suggests something broken in the Template.

Template:InfoboxSubsector doesn't seem to have the problem, as most subsector pages look OK.

I don't know enough about how the templates work to pin it down exactly, but there is one possibly suspect difference between the Template:InfoboxSubsectorSimple and Template:InfoboxSubsector. The first one says that the 'alg' code defines the colour of the bar and does something about categories. The second one only refers to the colour of the bar. I wonder if that points to where in the template definition the problem is? 212.219.243.126 07:02, 18 June 2015 (EDT)

Yes, the problem was the category generation at the bottom of the template based upon the Alg parameter was missing a bracket "{". Using a template requires two brackets (like this: "Template:" and ""). Using a named parameter in a template requires three brackets (like this: "{{{" and "}}}"). So in one template, passing a parameter to another template (recursively) you end up with large sequences of brackets (like "}}}}}"). As you can imagine, it's easy to get this wrong.
Part of the reason this was not fixed was we're deprecating the use of the Template:InfoboxSubsectorSimple. If you are editing a page where this template is used, please replace it with Template:InfoboxSubsector.
Tjoneslo (talk) 08:47, 18 June 2015 (EDT)
I have also noticed this problem. Template:InfoboxSubsector preference noted. Thanks, Thomas. Maksim-Smelchak (talk) 08:53, 18 June 2015 (EDT)