Question

Photo of Michael Garrison

0

Can't make a "Background check" profile badge

I like the "Background Check" feature that came with Rock v2.0, but we would like to surface the basic information on a profile badge.

I've created a badge with the following Liquid codes:

<div class="badge" style="position:relative;">
    {% if Person.BackgroundCheckResult == "Pass" -%}
    <i class="badge-icon fa fa-check" style="color:#090;" title="{{ Person.NickName }} passed a background check on {{ Person.BackgroundCheckDate }}"></i>
    {% endif -%}
    {% if Person.BackgroundCheckResult == "Fail" -%}
    <i class="badge-icon fa fa-exclamation-triangle" style="color:#F00;" title="{{ Person.NickName }} FAILED a background check on {{ Person.BackgroundCheckDate }}"></i>
    {% endif -%}
</div>

But the badge remains blank. I've put the <i> element outside of the conditionals, and it does show up. However it appears that Person.BackgroundCheckDate returns null, as does Person.BackgroundCheckResult. These are just person attributes, like Baptism Date and some other custom attributes I've created a badge for- what's different here?

  • Photo of Rock RMS

    0

    It's becuase of how those attributes are secured. Take a look at this issue for some insight.

    • Michael Garrison

      That makes sense. Will there be a version where the new AND the old Lava Attribute tags will both work so that we have a version during which we can find and transition our tags, rather than having everything just stop working in v3.0? Also, I wasn't aware that such a tag change was coming- is there any documentation on the new syntax anywhere (or other such breaking changes)? I can switch our attribute tags easily enough with azturner's example, but I'm not sure what a conditional would look like.
      Thanks

  • Photo of Rock RMS

    0

    Michael,

    We are very consious of how painful "breaking changes" can be and our goal is to not make any such changes between our "major" releases. So as long as you see "McKinley" in the version name, you should expect that there are not any breaking changes.

    The new Lava attribute syntax is actually available already in McKinley v2.0, so both the old and new formats are currently supported. All of the Lava syntax is documented at our Lava help page: http://www.rockrms.com/lava. If you look at the Attributes section, you will see documentation on the new format. You'll also notice that we've already started to document features that will be available in upcoming releases.

    As for using the new syntax in a conditional, you may need to make use of the assign tag. For example:

    <div class="badge" style="position:relative;">
        {% assign backgroundStatus = Person | Attribute:'BackgroundCheckResult' %}
        {% if backgroundStatus == "Pass" -%}
            <i class="badge-icon fa fa-check" style="color:#090;" title="{{ Person.NickName }} passed a background check on {{ Person.BackgroundCheckDate }}"></i>
        {% endif -%}
        {% if backgroundStatus == "Fail" -%}
            <i class="badge-icon fa fa-exclamation-triangle" style="color:#F00;" title="{{ Person.NickName }} FAILED a background check on {{ Person.BackgroundCheckDate }}"></i>
        {% endif -%}
    </div>
    • Michael Garrison

      I tried some of the new syntax on one of my existing badges, and it didn't seem to work. That's the only reason I asked. I'll take a look at that page (haven't seen that one before) and try again.
      Thanks!!

    • Michael Garrison

      OK, debug mode showed me the issue- I was using {{ CurrentPerson | Attribute:'key' }} per the example given on the bug report, but it needed to be {{ Person | Attribute:'key' }} instead.
      THANKS for building in both syntaxes this soon- I'll get to work on making sure I'm updated for the new.