{poll:poll_ids:expression}

Description

Reads data from one or more polls in the Polls module and prints it. A poll here is a single question - one row in the polls table - not the whole poll module. poll_ids is one or more poll ids separated by a dash; for each id the expression is evaluated against that poll and the results are concatenated with nothing between them. The expression can be a plain column of the polls table - headline (the question text), publish_date, expiry_date, params, design_id, module_id, id, status_code - in which case the stored value is returned as-is. Anything else is treated as a normal AA expression evaluated in the poll context, where the poll aliases are available: _#QUESTION (the question text), _#POLL_ID_, _#MODULEID, _#PUB_DATE, _#EXP_DATE, _#PARAMS__ and _#EDITPOLL (an admin edit link). An empty id, a lone dash, whitespace, or an empty expression all yield empty output, so a missing lookup never breaks the page. Two cautions. First, the poll: command ships with the Polls module and is only registered once that module has run on the page - for example after a polls: call, or inside a poll design template where the poll is already in scope; used entirely on its own with nothing to load the module, poll: is left as literal text. Second, a poll id that does not exist on the current install raises a fatal error rather than returning empty, so only ever pass ids that exist. The typical use is inside a poll design to print the current poll question, or to wrap a poll column such as publish_date in a date: expression for formatting.

Parameters

poll_ids optional default (empty - yields empty output)

One or more poll ids, separated by a dash. Each id is one poll question (a row in the polls table), not a whole poll module. Empty entries are dropped, so an empty id, a lone dash, or whitespace all yield empty output. A non-existent id raises a fatal error - only pass ids that exist on your install.

expression optional default (empty - yields empty output)

What to print for each poll. A bare polls column name (headline, publish_date, expiry_date, params, design_id, module_id, id, status_code) returns the stored value as-is. Anything else is evaluated as an AA expression in the poll context, where the poll aliases are available (_#QUESTION, _#POLL_ID_, _#MODULEID, 06/04/2026, 11/25/2031, _#PARAMS__, _#EDITPOLL). An empty expression yields empty output.

Examples

No item found