Share » Forums » Developer » Can self-embedding in editor be done?

Can self-embedding in editor be done?

Can self-embedding in editor be done?

Wednesday 09 December 2009 5:42:26 am - 3 replies

Author Message

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

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu