Una Macros & Poll module
Hi, macros really rock UNA. Just playing around a bit (thx to Cem , he first came out with his med wiki and of course Alex T⚜️ and the macro wiki).
Concerning the POLLS module and the POLL MACROS I wonder how to use the macros to show the poll answers and poll results correctiy.
I hope the attached images help to understand my question.
-
-
- · Peter
-
·
In reply to LeonidS
- ·
Thx Leonid S for the answer. But I tried both, they do not show any results. Tried in raw and html blocks, nothing is shown.
I wonder why, because the other macros work very well, so I dont think I did it completely wrong with the macros for result and answer. What could be the reason?
I tried both variations voters visible/hidden and results visible/hidden
Could it be that the system takes care of the users privacy?
-
-
·
Alex T⚜️
-
·
In reply to Peter
- ·
Thx Leonid S for the answer. But I tried both, they do not show any results. Tried in raw and html blocks, nothing is shown.
I wonder why, because the other macros work very well, so I dont think I did it completely wrong with the macros for result and answer. What could be the reason?
I tried both variations voters visible/hidden and results visible/hidden
Could it be that the system takes care of the users privacy?
Since this macro allows to show result for every poll even private one, then it's unsafe to use it directly, if you want to use any service method directly then you can use service block in Developer module.
-
·
Alex T⚜️
-
- · Peter
-
·
In reply to Alex T⚜️
- ·
Thank You, I will try the service block solution
-
- · Peter
-
·
In reply to Alex T⚜️
- ·
Are Macros in dev service blocks allowed?
Tried a service block in studio/dev/pages/homepage and entered the macro { {~bx_polls:get_block_poll_answers[...]~} }
I get the message TOKEN expired. So the Block will not be saved.
-
-
·
LeonidS
-
·
In reply to Peter
- ·
No, in the Developer app you should use the code like (Content field of the block):
array (
'module' => 'bx_polls',
'method' => 'get_block_results',
'params' =>
array (
0 => {poll_id}
)
)
-
·
LeonidS
-
- · Peter
-
·
In reply to LeonidS
- ·
Sorry LeonidS, just to inform You, Dev dont let me create a service block with this code. The saving process becomes endless and finally the new created block is not saved.
✅ I have entered the right [poll_id]
note. actually not really urgent but may be in some weeks...
-
-
·
LeonidS
- ·
UPDATE - confirmed that the service blocks with the exact polls id works fine.
-
·
LeonidS
-
- · Peter
-
·
In reply to LeonidS
- ·
Thank You very much LeonidS, your advice - as allways - very appreciated!