Feature request: To plugin API, add hook to inform about plugin having moved in structure editor

43 views
Skip to first unread message

Jacob Rief

unread,
Sep 24, 2020, 10:35:11 AM9/24/20
to django CMS developers
After a plugin has been moved inside the structure editor, no hook method is called
to inform the plugin that is has been moved inside the tree. This would be very
useful in some situations, for instance to recompute the grid widths, etc.

Implementing this is a no-brainer, just one additional line in 
class CMSPlugin(with_metaclass(PluginModelBase, MP_Node)):
    ...
    def move(self):
        ...
        self.get_bound_plugin().after_moved()
        ...

and an empty stub method after_moved().

Shall I implement this? Any objections about the name after_moved?

– Jacob

Petr Klus

unread,
Sep 24, 2020, 10:57:06 AM9/24/20
to django-cms...@googlegroups.com
Sounds like a good idea!

In terms of naming, I think after_move or move_after sounds a bit better, is there any example of similar functionality that we can align the naming with?

--
Message URL: https://groups.google.com/d/msg/django-cms-developers/topic-id/message-id
Unsubscribe: send a message to django-cms-devel...@googlegroups.com
---
You received this message because you are subscribed to the Google Groups "django CMS developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-cms-devel...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/django-cms-developers/2efe8d3b-4c29-4a6b-b098-70735ad7f37en%40googlegroups.com.


--
Petr Klus


Bonsai Tiger (UK)
24/25 The Shard
32 London Bridge Street
London
SE1 9SG
United Kingdom

"Bonsai Tiger" is a trading name of CNK Digital Solutions Ltd. A Limited Company registered in England and Wales | Company Number 7686919
Registered Address: Crown House, 27 Old Gloucester Street, London, WC1N 3AX
Reply all
Reply to author
Forward
0 new messages