I made some progress, but then again, i don't know if it's in the right direction.
Inside the render method of my parent class CMSGridPlugin(CMSPluginBase), i do this:
# get the placeholder instance and plugin instance of the current CMSGridPlugin
def _get_plugin_placeholder(instance, placeholder):
for placeholder in Placeholder.objects.filter(slot=placeholder):
plugins = placeholder.cmsplugin_set.filter(pk=instance.id
if plugins.count() == 1:
return (placeholder, plugins)
With this i get:
Meaning i get the correct placeholder for my current plugin.
The question remains:
How do i create a CMSProductPlugin instance, link it to ProductPlugin and set the foreign-Key of entity to a Product from Database? And ultimatly add this plugin to CMSGridPlugin, of which i got the placeholder and instance above.
---------- some definitions ---------
model = GridPlugin
model = ProductPlugin
entity = models.ForeignKey(Product)
I do not care if i have to save those plugins in Database, but i think it should be possible not to.