Forums / Setup & design / Poll embedded in page

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!

eZ debug

Timing: Jan 19 2025 01:19:12
Script start
Timing: Jan 19 2025 01:19:12
Module start 'content'
Timing: Jan 19 2025 01:19:12
Module end 'content'
Timing: Jan 19 2025 01:19:13
Script end

Main resources:

Total runtime0.9568 sec
Peak memory usage4,096.0000 KB
Database Queries209

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0085 588.9453180.8438
Module start 'content' 0.00850.8341 769.7891599.8203
Module end 'content' 0.84270.1140 1,369.6094341.0703
Script end 0.9567  1,710.6797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00440.4594210.0002
Check MTime0.00150.1613210.0001
Mysql Total
Database connection0.00100.103310.0010
Mysqli_queries0.878691.82732090.0042
Looping result0.00190.19752070.0000
Template Total0.925196.720.4625
Template load0.00310.324620.0016
Template processing0.922096.361820.4610
Template load and register function0.00020.025510.0002
states
state_id_array0.00140.147210.0014
state_identifier_array0.00090.089120.0004
Override
Cache load0.00270.2815330.0001
Sytem overhead
Fetch class attribute can translate value0.00120.128730.0004
Fetch class attribute name0.00110.115390.0001
XML
Image XML parsing0.00100.109130.0003
class_abstraction
Instantiating content class attribute0.00000.0019110.0000
General
dbfile0.00250.2567280.0001
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 30
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs