Question

Photo of Arran France

0

Adjusting Group Toolbox List Lava

I've been playing around with the group toolbox today and it's really fantastic. To suit our needs better I'm trying to customise the Group List Lava block to only display groups that the current person is a leader of.

I understand that this block is adjustable via Lava but I'm at a loss as to whether the visibility of groups on that list is something I can adjust via Lava and if so, how!

I see in the debug that there's an array that contains all the group members which contains a field IsLeader (either true or false) and I assume I'm able to do some sort of if statement to test whether the current persion ID matches any of the person IDs in the group array where the IsLeader is False but once I get there I'm a bit stuck.

Has anyone else achieved something similar?

 

  • Jeremy Turgeon

    Do you want to limit what a group member can see once they click into their small group or prevent them from seeing the group link to begin with?

  • Arran France

    Hey Jeremy,
    Today I set the group type permissions for members to deny view permissions but they're still able to see the link which seems a bit backwards if they can't actually see anything if they click on it.


    I've altered the question to clarify that.

  • Photo of Arran France

    0

    I've  been a bit thick with this. I was looking at the {% include %} thinking "How am I meant to modify based on that?". Then I had a brainwave to actually look at the .lava file it was referencing...

    To achieve what I wanted I looked at the Lava file (I'm using the Flat theme for the microsite), copied that, and made my changes. Then I went into the block settings, deleted the existing include Lava tag, and then pasted in my modified code (below).

     

    <div class="panel panel-default">
      <div class="panel-heading">Groups</div>

      {% assign groupCount = Groups | Size %}

      {% if groupCount == 0 %}
        <div class="margin-all-md"> No Groups Available To List</div>
      {% endif %}

      <ul class="list-group list-group-panel">
        {% for group in Groups %}

          {% if group.IsLeader %}
             <li class="list-group-item">
              <a href="{{ LinkedPages.DetailPage }}?GroupId={{group.Group.Id}}" class="js-group-item" data-toggle="tooltip" data-placement="top" title="{{ group.GroupType }}">
                {{ group.Group.Name }}
              </a>
            </li>
            {% endif %}
          

        {% endfor %}
      </ul>

    </div>

    <script type="text/javascript">

      $( document ).ready(function() {
        $('.js-group-item').tooltip();
      });

    </script>