Free-Conversant Support / Macro: insertQuery
 Home   About Conversant   Free Sites   Hosting   Support   XML-RPC 

Search



Documentation >> Macros >> insertQuery

<!--#insertQuery-->

Returns rendered result of a default query stored in an Advanced Query Page.

Example:

  • <!--#insertQuery aqpPath="path/to/aqp"-->

Required Attributes:

  • aqpPath="[path to Advanced Query Page]" : The path to an advanced query page within the conversation. Path should be specified from the base of the site -- for example, if you have an AQP at "http://www.free-conversant.com/[mysite]/myFolder/myAQP", the aqpPath for the insertQuery macro would be "myFolder/myAQP". The AQP's specified default query options (in the structure editor) will be used to construct the results of the macro.

Optional Attributes

  • resultTemplate="[string]" : Name of a template defined in the admin site's Template editor. This template is used for as the main template for the macro's content. Default: Result template of the AQP specified in the aqpPath attribute.
  • msgTemplate="[string]" : Name of a template defined in the admin site's Template editor. This template is used for each repeating message in the query results. Default: Message template of the AQP specified in the aqpPath attribute.
  • limit="[number]" : Maximum number of messages from the query result to display. Defaults to "Items per page" property of the AQP specified in the aqpPath attribute.
  • first="[number]" : First message of the result to display, ie, if first="10", the first 9 messages will be skipped and the macro will begin rendering at the 10th message in the results. Default: 1.
  • cache="[true/false]" : Should the default query cache from the AQP be used. Default: Value stored in the "Cache default query" property of the AQP.

Usage

Essentially, this macro is designed to allow you to display the contents of an Advanced Query Page's default query elsewhere in your conversation...for use creating Tables of Content, lists of recently posted messages, etc. For more details on configuring the default query, see the Advanced Query Page documentation.

The macro also lets you override certain key values to control the appearance of the resulting html, such as the rendering templates being used.

The insertQuery macro is not a fully functional AQP embedded in another page...while the AQP's special template macros, such as those linking to different sort orders, and Previous/Next sets of results will work in the context of the macro, they will point back to the original AQP, not the same page as the macro is displayed.

Running and rendering queries is a relatively resource intensive operation for the server, so be aware that using numerous insertQuery macros in the same page may have unacceptable performance. Use your judgement when designing using the macro.

View in DG