Poll embedded in page

Author Message

Emma Williams

Friday 13 April 2007 1:07:37 am

I have created a Poll class and have it working on it's own page, but ideally I need to have the poll embedded in the homepage. Is there a way of doing this? I've spent a while looking into this but with no success. I considered an iframe, which could work except the poll page is still using homepage template (ie menus, logos etc) and I can't work out how to stop it using this template. I have been looking at the override poll tpl files but nothing seems to be working so far! Is there a simple way to embed a poll? I notice there is a poll_embed.tpl file but I'm finding little in the way of documentation on using polls within ezpublish.

André R.

Friday 13 April 2007 4:15:47 am

svn server seems to be down, but poll is one of the things included in next version of ezwebin.
And the embed template should be somewhere here:

http://svn.ez.no/svn/extensions/ezwebin/trunk/packages/ezwebin_extension/ezextension/ezwebin/design/ezwebin/override/templates/embed/poll.tpl

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Emma Williams

Friday 13 April 2007 8:06:43 pm

So how do I use the code in that tpl? I'm very new to EZpublish I should point out! I have worked out how to use override templates for full pages, but I still don't understand how to embed the content of another object/form/article/poll/whatever into another page. Do I need to copy that tpl file into my override homepage template file?

André R.

Saturday 14 April 2007 8:43:36 am

You get embed content when you click the attachement icon while editing a xml-Block ( ~Rich text area ) and adding a existing page (in your case a poll).
http://ez.no/doc/extensions/online_editor/4_x/usage/the_toolbar/the_object_button

You can also display the embed view of something in templates manually using this:
http://ez.no/doc/ez_publish/technical_manual/3_8/reference/template_functions/visualization/content_view_gui

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Emma Williams

Monday 16 April 2007 12:15:58 am

Thanks, yes I just realised that I was trying to add the embed code to a Text Line section instead of XML Block, which is why it kept coming out as text link instead.

Emma Williams

Monday 16 April 2007 12:43:45 am

*sigh* ok I am almost there. The content_view_gui, as pointed out, is obviously what I need to use, but I still cannot work out from the documentation HOW I use it. I have established that you can embed objects by referring to their NODE id if you're embedding thru the admin area. But do I still use the node id when adding content_view_gui to a template file, and if so where do I put it?

So in:
{content_view_gui content_object=object view=embed }

where do I state what object it needs to add? "content_object=object"?

I appreciate any help, as I'm finding the official documentation to be extremely lacking.

André R.

Monday 16 April 2007 1:55:10 am

{* First fetch the node you want *}
{def $my_node = fetch('content', 'node', hash('node_id',  NODE_ID_NUMBER_HERE))}
{content_view_gui content_object=$my_node.object view='embed'}

or

{* Fetch the object directly *}
{def $my_object = fetch('content', 'object', hash('object_id',  OBJECT_ID_NUMBER_HERE))}
{content_view_gui content_object=$my_object view='embed'}

Hope this helps :)

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Emma Williams

Monday 16 April 2007 5:02:24 am

Thanks so much! Just what I was trying to do!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.