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.

eZ debug

Timing: Jan 19 2025 04:26:38
Script start
Timing: Jan 19 2025 04:26:38
Module start 'layout'
Timing: Jan 19 2025 04:26:38
Module start 'content'
Timing: Jan 19 2025 04:26:39
Module end 'content'
Timing: Jan 19 2025 04:26:39
Script end

Main resources:

Total runtime0.6155 sec
Peak memory usage4,096.0000 KB
Database Queries72

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 589.1484152.6250
Module start 'layout' 0.00460.0021 741.773439.4453
Module start 'content' 0.00670.6072 781.2188594.7422
Module end 'content' 0.61390.0015 1,375.960920.1719
Script end 0.6154  1,396.1328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00280.4622160.0002
Check MTime0.00120.1894160.0001
Mysql Total
Database connection0.00060.097710.0006
Mysqli_queries0.559190.8373720.0078
Looping result0.00050.0888700.0000
Template Total0.590996.020.2955
Template load0.00170.282420.0009
Template processing0.589295.731720.2946
Template load and register function0.00020.031710.0002
states
state_id_array0.00100.168710.0010
state_identifier_array0.00060.103020.0003
Override
Cache load0.00150.2454330.0000
Sytem overhead
Fetch class attribute can translate value0.00060.090720.0003
Fetch class attribute name0.00110.184390.0001
XML
Image XML parsing0.00070.106320.0003
class_abstraction
Instantiating content class attribute0.00000.0069110.0000
General
dbfile0.00100.1598170.0001
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 30
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs