postmatic / epoch

WordPress commenting perfected.
38 stars 14 forks source link

Add hooks to provide custom templates by theme & plugin authors #84

Open mundschenk-at opened 9 years ago

mundschenk-at commented 9 years ago

Please add hooks allow theme and plugin authors to provide customized templates for Epoch commenting. Even the current "minimal" option rewrites the theme templates in an unpredictable way. Instead you could provide (action or filter) hooks and corresponding documentation (necessary classnames/ids) to programmatically add our own templates.

I know this is partially redundant with #78, but it is not quite the same thing. If not touching the existing templates is not a technical option (I haven't checked how hard it is to inject the necessary information into the existing template structure), providing infrastructure for explicit support in a theme might be more feasible.

Vernal commented 9 years ago

Hey Pep. The Epoch comment templates are based on handlebars and creating your own should be pretty easy. Would you like to propose a method for making that happen? I'm happy to fold in a PR.

mundschenk-at commented 9 years ago

I'm not familiar with handlebars, but from the intro on their webpage the templating language looks easy to use. However, is there any documentation on which class names and IDs Epoch needs to function properly? (I assume that you don't target specific tags.)

ronalfy commented 9 years ago

Could use locate_template for theme authors. I've seen other plugins use this with great success.

Hard part is the docs and backwards compat once that is in place. Basically WooCommerce woes.

ronalfy commented 9 years ago

Another caveat is custom plugins adding to the template. Use-case would be adding Slack-like reactions, up/down votes, featured comment, etc. just something to keep in mind.

mundschenk-at commented 9 years ago

I've had great success with using https://github.com/GaryJones/Gamajo-Template-Loader to load templates from plugins (i.e. searching the theme hierarchy while defaulting to a template provided by the plugin).

Vernal commented 7 years ago

I'm going to leave this open for us to evaluate a bit more when 2.0 gets more refined.

I think it's still a very good idea but let's see how the code settles first.