punch icon indicating copy to clipboard operation
punch copied to clipboard

Provide a way to add multiple content handlers

Open naholyr opened this issue 11 years ago • 8 comments

We can have many helpers, hooks, etc… but only one content handler, this makes it quite uneasy to append new content handlers above existing ones. For example in my case I use:

  • my dedicated custom content handler for some specific pages, which falls back to…
  • a content handler generating RSS, itself using…
  • blog-content-handler, which falls back to…
  • default content handler

Maybe the content_handler(s?) option could be an array, and core would:

  • unshift default content handler (so it's always here, cannot be disabled, or another option?)
  • concatenate all their "getSections" & co
  • for every negotiation: call all "negotiateContent", and merge provided contents (in the same order, last handler = most priority)

I don't think this would be too hard to do. What do you think? Do you see major issues with this vision (before I start working on PR)?

naholyr avatar Jan 29 '13 00:01 naholyr