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.

  • 773
  • More
Attachments
Replies (9)
    • Hello Peter !

      You may write:

      { {~bx_polls:get_block_poll_answers[insert poll ID here]~} }
      { {~bx_polls:get_block_poll_results[insert poll ID here ]~} }

      The first one shows the available answers, the second - poll results.

      • 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

        image_transcoder.php?o=bx_froala_image&h=4264&dpx=2&t=1606385674

        Could it be that the system takes care of the users privacy?

        • 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

          image_transcoder.php?o=bx_froala_image&h=4264&dpx=2&t=1606385674

          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.

          • Thank You, I will try the service block solution

            • 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. 

              • 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}

                )

                )

                • 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...

                  • UPDATE - confirmed that the service blocks with the exact polls id works fine.

                    • Thank You very much LeonidS, your advice - as allways - very appreciated!

                      Login or Join to comment.