tierra / topicsolved

phpBB Topic Solved extension: Allows posting questions, and accepting answers as solved.
https://www.phpbb.com/customise/db/extension/topic_solved/
GNU General Public License v2.0
23 stars 19 forks source link

What template is used for solved post and solved list? #53

Closed BlackSkorpio closed 7 years ago

BlackSkorpio commented 8 years ago

Hi I'm trying to create my own set of templates, and so far I have the viewtopic_topic_title_append.html solved.

But I also need to have an example of the template used for the solved post and solved list

Basically what I trying to achieve is to replace the images with a simple:

<i class="fa fa-check" aria-hidden="true"></i>
tierra commented 8 years ago

It actually doesn't have a template in most cases. It's rendered from the various events found in event/main_listener.php

BlackSkorpio commented 8 years ago

I was afraid you would say that! :/

Any chance you can give hints of where I would need to edit it to "get rid off" the images?

tierra commented 8 years ago

We've used font icons for the post button in some of the styles, but I'm not really sure what the best approach would be to use a font icon in the solved indicator. I believe it would have to be modifications to the extension code itself, and not just some theming changes. It would be nice to make this easier to customize, and I probably would have designed it that way initially, except that the primary goal was to provide an upgrade path from the old Topic Solved MOD for phpBB 3.0.x, which used this same customizable text and image.

tierra commented 8 years ago

This isn't ideal either, but one thing you could try is to include some custom javascript that would find and replace all solved indicators on the page with the font icon after the page has loaded.

BlackSkorpio commented 8 years ago

Sorry, but that is a path that I want to avoid actually :(

I have as a work around created a custom buttons.css, but was hoping to be able to customize those two parts "native" via templates.

Would maybe consider adding those two to the templates for a future version? That would make it much smoother to customize that way :D

tierra commented 8 years ago

Sure, if the changes don't break any of the existing functionality, and look good, I'm open to applying them. If they do break some existing functionality, but are possible entirely with CSS changes only, you could consider using the approach of installing your own custom extension that applies your styles (that override the ones provided with this extension). I do this in my own phpBB installation using this extension for example.

BlackSkorpio commented 8 years ago

Adding those two events to the templates, should not have any impact on the look since it would still be the same (default). Instead it will just add to the possibilities to the plugin: sites would be able to create "there look and feel" in a very easy manner.

It should not break anything, since it still is the same behavior/actions: but I might be wrong here since it was a very long time since I actually tinkered with the phpBB3 code it self.

tierra commented 7 years ago

I have included a new event in 8e4bc72218129135c203176b5c10d5d7100d69f5 which can be used to alter the solved indicator icon used (when not using text indicators), just for phpBB 3.2+.

Simply hook into the new tierra.topicsolved.render_icon event, and return the desired icon classes, color, url, and alternative text you wish to be used.