Positive/Negative class names
Hi,
For the theme I'm having to make for a client at the moment, he wants the counts colour coded so that positive reactions have a green count, and negative red. I've added a class name to do this myself, however I have to re-apply these changes after each update, which is a little annoying. I could see this functionality being useful to others, so I was wondering if there was any possibility of this being included in a future update?
Here is the code I am currently using for it // /yaga/library/functions.render.php - Starting from line 22 foreach($Reactions as $Action) { if(CheckPermission($Action->Permission)) { $CountString = ($ShowCount && $Action->Count) ? $Action->Count : ''; $Alignment = ( $Action->AwardValue > 0 ? ' ReactPositive' : ' ReactNegative' ); // Code Added $ActionsString .= Anchor( Wrap(' ', 'span', array('class' => 'ReactSprite React-' . $Action->ActionID . ' ' . $Action->CssClass)) . WrapIf($CountString, 'span', array('class' => 'Count')) . Wrap($Action->Name, 'span', array('class' => 'ReactLabel')), 'react/' . $Type . '/' . $ID . '/' . $Action->ActionID, array( 'class' => 'Hijack ReactButton' . $Alignment, // Code Added 'title' => $Action->Tooltip) ); } }
Thanks
Comments
Thanks for using my addon!
You can currently modify the CSS class for actions in the dashboard. When editing an action, click on the advanced options label and append your desired class after the current class.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
I guess you hear it quite often, but I think I haven't said it by now: that application is a versatile masterpiece!
Yeah true, it was just much easier to hardcode it as the client is yet to set up their desired reactions.
I have to agree with you there, probably the best piece of code I've seen for Vanilla yet.
EDIT: I'm starting to think the only users on this forum are you two and peregrine!
@hgtonight Also I'm not sure if this is just for me, but there appears to be a closing div missing somewhere within YAGA. When I enable the plugin, my #Panel moves inside of my #Content. For the time being I've added an extra to the dashboard/view/profile/index.php
I am very interested in finding bugs like this.
Also, thanks for the kind words
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
@hgtonight
Theme
Custom Theme; However it can be replicated within the default theme: If you change
<div class="Column PanelColumn" id="Panel"> {module name="MeModule"} {asset name="Panel"} </div> <div class="Column ContentColumn" id="Content">{asset name="Content"}</div>
to
<div class="Column ContentColumn" id="Content">{asset name="Content"}</div> <div class="Column PanelColumn" id="Panel"> {module name="MeModule"} {asset name="Panel"} </div>
(i.e. move the panel to after the content)
Page
Viewing profile (e.g. http://vanillaforums.org/profile/54556/SudoCat )
Panel Modules
Error persists with all other addons disabled. Only modules are the Photo and ProfileFilters.
You found a bug in the Reaction Count display. The fix is on GitHub in this commit. It will be included in the next release.
Thanks for helping me make my addon better!
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Not a problem! Glad to try and contribute to the community