multiple PlaceholderField base on a template #2738

Open
avoine opened this Issue Feb 26, 2014 · 3 comments

4 participants

@avoine

I'm trying to think about what it would take to add the "dynamic" template
scanning fonctionnality of the Page model to an outside models.

PlaceholderField is great if you have only a few placeholder that
you want to add and if you know there names in advance.

So here's what I come with so far:

A model mixin that would:

  • Add a ManyToManyField field named placeholders like for the Page model.
  • That would check for a template_name attribute to the class.
  • And that would call rescan_placeholders() or listen to the update_placeholders signal.
  • Modify PlaceholderAdmin to grab and display those changes like PageAdmin would do.

What do you think?

@avoine

I just relalized that the "placeholder" templatetag would not render plugins from my model.
Is this a feature? Would it be to much to modify the "placeholder" templatetag to check for placeholders in something else then "request.current_page"?

@digi604
Divio AG member

if we could decouple this... that would be awesome

@yakky yakky added this to the Some Day milestone Sep 29, 2014
@FinalAngel
Divio AG member

@yakky @mkoistinen any way you see how to achieve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment