Problem/Motivation

The total reaction count is not enclosed in HTML div or span tags thus making it difficult to target when theming.

Steps to reproduce

Add reactions widget and try to theme the total reactions in CSS or target with JS.

Proposed resolution

Wrap the output with a span and give it a class name - done here: VotingApiReactionForm.php

Comments

jaydee1818 created an issue. See original summary.

jaydee1818’s picture

elaman’s picture

Status: Active » Closed (works as designed)
StatusFileSize
new259.28 KB

Please read the module's description.

It describes that `votingapi-reaction-item.html.twig` allows you to control how info is displayed. The vote count is displayed in a div with votingapi-reaction-count class. However, you can edit the twig file to do it any way you want.

jaydee1818’s picture

StatusFileSize
new43.86 KB
new480.77 KB

Hi elaman - please take another look as the template file you have indicated only works on the individual widgets. I have added some images to help explain.

jaydee1818’s picture

Status: Closed (works as designed) » Needs review
elaman’s picture

Hi, @jaydee1818. The total count is displayed as a part of a simple form. In drupal, you can theme any form in your custom theme.

https://www.drupal.org/forum/support/module-development-and-code-questio...

jaydee1818’s picture

OK no worries - I just thought it would be helpful to have some default HTML wrapped around that string so it's more easily themable with only css and not needing to write PHP to alter it.

jaydee1818’s picture

I found that I also had to make the change to the submitForm function.

elaman’s picture

Status: Needs review » Fixed

Fixed by changing the count element to item, now it should have classes provided by Drupal FormElement.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.