0

I want to show poll on a cms page. I have used the following code but I could not see it.

{{block type="poll/activePoll" name="right.poll" as="poll" template="poll/active.phtml"}}

I tried to enable it using reference to content block. But when I do that it shows up either at the top or at the bottom. I also tried using below and after attributes but no luck. I cant get it where I want. Ideal solution would be a way to write some code in CMS page wrapping divs around it so I can get it where I want it.

Thanks, kiran

1 Answer 1

2

Adding a block like that will add the block in the content only not on sidebar or other part of the layout. To add the poll on the right sidebar of your CMS page. Go on your administration, "CMS" => "Pages". Select the page you need to add your poll in the grid and edit it. In the design tab, add the following content:

<reference name="right">
        <block type="poll/activePoll" name="right.poll">
            <action method="setPollTemplate"><template>poll/active.phtml</template><type>poll</type></action>
            <action method="setPollTemplate"><template>poll/result.phtml</template><type>results</type></action>
        </block>
</reference>

Hope my answer will help you

4
  • I dint say I want to show poll block on right sidebar. I know how to show it on right side bar. It is by default shows poll block on right side bar. I want to insert poll block in a cms page
    – KA.
    Aug 28, 2012 at 11:45
  • Ok so just replacing the <reference name="right"> by <reference name="content"> should do the stuff. Or maybe I still do not understood what you expect?
    – Loic FARGE
    Aug 29, 2012 at 6:12
  • If you read my question, yes I did reference to content.problem is it shows up either at the top or at the bottom. I cant place it exactly where I need it.
    – KA.
    Aug 29, 2012 at 11:38
  • After searching for more than a day I couldnt find a way to insert poll block in a CMS page. All I could do is creating a new structural block in page.xml and then referred the poll block to newly created block . It solved my problem but I had to divide page into more structural blocks than I expected. Not sure if this is right way but i got output I needed.
    – KA.
    Aug 29, 2012 at 11:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.