On Fri, Aug 29, 2008 at 1:45 PM, Bobby S bobbys@gmail.com wrote:
I have a parameterized template. The end result of this template would be a sortable wikitable where each parameter value would create a row. If that value didn't exist I would use the #if parser function to hide that row from the results. My question is this:
What if I don't end up with any values for the parameters thus producing zero table rows? Is there a way to hide the top/bottom of the table and put something in its place such as "No values were given for this article" as text?
You can use #if as well for it — just wrap the entire table with the title into {{#if:{{{param1|}}}{{{param2|}}}{{{param3|}}}{{{paramEtc|}}}|...your table code...|''No parameters were specified.''}}. If any parameter is set, it would trigger the outer #if because it then gets a non-empty value.
Don't forget to escape the table's |s with {{!}} or a similar construction.
— Kalan