Displaying Poll Results in Content Studio
You can very easily get
Content Studio
to display the results of polls by adding a single field to your
poll
content type. The field you add must have the
following characteristic:
-
It must be a
basic
field -
It must have a
mime-type
ofapplication/xhmtl+xml
-
It must have a
result
sub-element with anenabled
attribute value set totrue
. This element must belong to the namespacehttp://xmlns.escenic.com/2014/poll
.
The following example shows such a poll
with a
result field (highlighted):
<field-group name="poll"> <field mime-type="text/plain" type="basic" name="title"> <ui:label>Title</ui:label> </field> <field mime-type="text/plain" type="basic" name="question"> <ui:label>Question</ui:label> </field> <field mime-type="text/plain" type="basic" name="svar1"> <ui:label>Alternative 1</ui:label> </field> <field mime-type="text/plain" type="basic" name="svar2"> <ui:label>Alternative 2</ui:label> </field> <field mime-type="text/plain" type="basic" name="svar3"> <ui:label>Alternative 3</ui:label> </field> <field name="pollresult" type="basic" mime-type="application/xhmtl+xml"> <poll:result enabled="true" /> </field> </field-group> <content-type name="poll"> <panel name="default"> <ref-field-group name="poll"/> </panel> </content-type>
This is what the resulting content items look like in Content Studio: