2.1 Reactions are not easily extended

Jake B.

Well-known member
There are some things which are difficult to do when extending reactions because the reaction is rendered entirely within the fnReaction templater method. If this instead obtained data from a separate function and then rendered a template using those parameters it'd be much cleaner/easier for a developer to change up the attributes for various reasons (changing the tag, for example)
 
Upvote 7
Happy to consider changes here, but we'll need some context as to what the use case is exactly. Changing the HTML structure and the tag specifically isn't necessarily something we would want to encourage, for example, so we'll certainly need much more detail.
 
One specific use case is that I'm extending reactions to allow non-images (emoji, Font Awesome, etc.). I've gotten it to work with the current system, but it requires quite a bit of duplication of code (though any XF changes will still apply because images fallback to the default function, and everything else is routed to a separate function I've created), as well as adding things like a counter onto the reaction summary
 
Last edited:
Just wanted to bump this and see if there are any plans to change this before the 2.1 release as this is making things quite a bit more difficult than they should be for us.
 
Happy to consider changes here, but we'll need some context as to what the use case is exactly. Changing the HTML structure and the tag specifically isn't necessarily something we would want to encourage, for example, so we'll certainly need much more detail.
I'm not sure what the issue would be with it using the regular templates system so styles can have the reaction layout they want? I personally want to mimic the "Post Ratings" addon layout to display more than 3 reactions as well as the reaction count but currently that's handled all in fnReactions which makes it much more annoying to customize.
 
Back
Top Bottom