Forums / Developer / Can self-embedding in editor be done?

Can self-embedding in editor be done?

Author Message

zurgutt -

Wednesday 09 December 2009 5:42:26 am

I want user to be able to edit a folders body and use Embed object with same folder and "Horizontally listed sub items" class to display lists of its children. The reason for this is more possibilities for styling that when hardcoding in template.

There is not danger template recursion if full view is not picked for embedded object.

Editor does not permit self-embedding tho. I am wondering if something breaks bad if i just remove that check from kernel?

Certified eZ developer looking for projects.
zurgutt at gg.ee

Mark Simon

Wednesday 09 December 2009 7:05:25 am

I'm not sure what You mean with

I want user to be able to edit a folders body and use Embed object with same folder ...

If You want to embed objects into the body of a folder, that have this folder as parent, there will not be recursion.
If You want to embed silblings and/or the folder this can cause recursions. I suggest to make an own template to show embedded objects. Include that template in the view of the folder. And use a counter couning every time this template is being included, to set a maximum account to the recursion.

Remember to initialise the counter on the outside (in the folder -view)
and increment it on the inside (the own template)

if your counter comes to a maximum, stop the complete functionality of the template.

Making changes to the kernel is pretty seldom a good idea. especially the recursion lock is something i wouldn't touch.

www.all2e.com

Peter Keung

Wednesday 09 December 2009 11:31:00 am

Workarounds:

  • Create a custom tag specifically for so-called "self-embedding" with an attribute representing the styles you want to support. The custom tag's template can then call an embed template as needed.
  • Embed the folder into another object and then embed that object back into the folder. Sounds silly but has worked rather intuitively for users in the case of building things like side menus.

http://www.mugo.ca
Mugo Web, eZ Partner in Vancouver, Canada

zurgutt -

Thursday 10 December 2009 3:34:15 am

"

Workarounds:

  • Create a custom tag specifically for so-called "self-embedding" with an attribute representing the styles you want to support. The custom tag's template can then call an embed template as needed.
  • Embed the folder into another object and then embed that object back into the folder. Sounds silly but has worked rather intuitively for users in the case of building things like side menus.
"

Custom tag is the route i took eventually. It works fine but complicates user experience a bit. Thanks for good suggestions, Peter.

Certified eZ developer looking for projects.
zurgutt at gg.ee

eZ debug

Timing: Jan 17 2025 23:58:03
Script start
Timing: Jan 17 2025 23:58:03
Module start 'content'
Timing: Jan 17 2025 23:58:04
Module end 'content'
Timing: Jan 17 2025 23:58:04
Script end

Main resources:

Total runtime1.3836 sec
Peak memory usage4,096.0000 KB
Database Queries199

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 587.7344180.8281
Module start 'content' 0.00481.2249 768.5625613.7656
Module end 'content' 1.22970.1538 1,382.3281337.3672
Script end 1.3835  1,719.6953 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.2941210.0002
Check MTime0.00150.1075210.0001
Mysql Total
Database connection0.00080.058310.0008
Mysqli_queries1.291693.34591990.0065
Looping result0.00220.15661970.0000
Template Total1.361498.420.6807
Template load0.00220.159520.0011
Template processing1.359298.231220.6796
Template load and register function0.00010.010710.0001
states
state_id_array0.00040.025510.0004
state_identifier_array0.00060.046520.0003
Override
Cache load0.00190.1383310.0001
Sytem overhead
Fetch class attribute can translate value0.00130.095040.0003
Fetch class attribute name0.00150.110670.0002
XML
Image XML parsing0.00600.435940.0015
class_abstraction
Instantiating content class attribute0.00000.000980.0000
General
dbfile0.01090.7893410.0003
String conversion0.00000.000330.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
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
2content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
1content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 25
 Number of unique templates used: 10

Time used to render debug report: 0.0002 secs