Template:Query/Advanced

{{#invoke:CargoQuery|main |q?tables ={{#if:{{#var:table}}|{{#var:table}}|{{{from|}}}}} |q?fields ={{#ifeq:|Query/Entry||{{{fields|filename=icon,name=text,_pageName=pagename,}}}}}{{#if:{{#var:table}}|{{Query/Fields|{{#var:table}}}}|{{{select|}}}}}{{{inject|}}} |q?join   ={{#if:{{#var:table}}||{{{join|}}}}} |q?where  ={{{where|}}} |q?orderBy ={{{order|}}} |q?groupBy ={{{group|}}} |q?limit  ={{{limit|250}}} |intro    ={{#ifeq:{{#var:template}}|Query/Entry|{{#if:{{#var:table}}|{{Query/Header|{{#var:table}}|collapsed={{{collapsed|}}}|margin={{{margin|}}}}}|{{{header|}}}}}|{{{header|}}}}} |outro    ={{#ifeq:{{#var:template}}|Query/Entry| {{!}}}|{{{footer|}}}}} |template ={{#ifeq:{{#var:template}}|Icon_Inline|Icon_Inline|}} |named args=yes |default= }}