Forums / Developer / Can self-embedding in editor be done?
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:
http://www.mugo.ca Mugo Web, eZ Partner in Vancouver, Canada
Thursday 10 December 2009 3:34:15 am
Custom tag is the route i took eventually. It works fine but complicates user experience a bit. Thanks for good suggestions, Peter.