Question

Photo of Austin Barnett

0

Badge Creation for Giving - Lava

OK, so i successfully created my first badge for Person.Member and now i'm trying to figure out how to show a badge if they are an active giver.  Does anyone have any ideas?

Here is what i have so far...

{% if Person.TotalGiving != empty -%}
                    <div class="badge badge-partner" style="color:green" data-original-title="{{ Person.TotalGiving }} is an active giver.">
                        <i class="badge-icon fa fa-money"></i>
                    </div>
                {% else -%}
                    <div class="badge badge-partner" style="color:green" data-original-title="{{ Person.TotalGiving }} is not an active giver.">
                        <i class="badge-icon badge-disabled fa fa-money"></i>
                    </div>
                {% endif -%}

 

Thanks so much for your help!

Austin

  • Photo of Michael Garrison

    0

    Austin, I don't see that Person.TotalGiving is a valid attribute. Have you turned on debug mode to check the name and values of all the available attributes for a person?

    I think the only giving-related attribute you can access is GivingGroupId - which is probably something you need anyway, so that giving credited to a wife also indicates that her husband is an "active giver".

    The only way to get this information, as far as I'm currently aware, is through some SQL queries- you'd have to get the GivingGroupId for the current person and get COUNT(*) for all of the rows in FinancialTransaction credited to a person with the same GivingGroupId...if COUNT(*) was > 1, that would be your != empty. But although I could be wrong, I don't think that Lava badges have a filter allowing you to execute a SQL query- I think that would be a security issue.

    Sorry this isn't exactly a helpful answer, but I'm not sure there's a way to create an actual badge with this information without writing a custom Rock plugin to add a badge type.