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

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 29 2025 14:40:50
Script start
Timing: Jan 29 2025 14:40:50
Module start 'layout'
Timing: Jan 29 2025 14:40:50
Module start 'content'
Timing: Jan 29 2025 14:40:50
Module end 'content'
Timing: Jan 29 2025 14:40:50
Script end

Main resources:

Total runtime0.0172 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 588.1563151.2109
Module start 'layout' 0.00540.0033 739.367236.6484
Module start 'content' 0.00870.0067 776.015694.8906
Module end 'content' 0.01540.0018 870.906333.9922
Script end 0.0172  904.8984 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002816.0600140.0002
Check MTime0.00126.8346140.0001
Mysql Total
Database connection0.00084.363410.0008
Mysqli_queries0.003419.836030.0011
Looping result0.00000.076210.0000
Template Total0.00137.810.0013
Template load0.00106.100410.0010
Template processing0.00031.620710.0003
Override
Cache load0.00084.363410.0008
General
dbfile0.002011.376680.0002
String conversion0.00000.045740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs