Magento: Mostrar bloque de encuesta en una página CMS

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

preguntado el 28 de agosto de 12 a las 11:08

1 Respuestas

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

Respondido 28 ago 12, 12:08

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 - kiran ambati

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

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. - kiran ambati

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. - kiran ambati

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.