Advertisement
DataCCIW

Bookmarked Groups Lava

Apr 8th, 2022 (edited)
1,291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.71 KB | None | 0 0
  1. //- variation on this recipe: https://community.rockrms.com/recipes/282/add-a-bookmarked-groups-panel-to-the-person-profile#NoteRef-482a9b716687460f997e56ab63267926
  2. //- Find all groups the logged in users is following and this individual is a member of
  3. {% sql loggedInPersonId:'{{ CurrentPerson.Id }}' personId:'{{ Context.Person.Id }}'  %}
  4.     SELECT G.Id, G.[Name]
  5.     FROM [dbo].[Following] F
  6.         JOIN PersonAlias PA on PA.Id = F.PersonAliasId
  7.         JOIN Person P on P.Id = PA.PersonId  
  8.         JOIN [Group] G on G.Id = F.EntityId
  9.         JOIN GroupMember GM on GM.GroupId = G.Id
  10.     WHERE EntityTypeId = 16
  11.         AND P.ID = @loggedInPersonId -- CurrentLogged in User
  12.        AND GM.PersonId = @personId -- Current Person
  13. {% endsql %}
  14.  
  15.  
  16. //- Format the display
  17. <div class='panel panel-persondetails'>
  18.     <div class='panel-heading rollover-container clearfix'>
  19.         <h3 class='panel-title pull-left'><i class='fa fa-bookmark'></i> Bookmarked Groups</h3>
  20.                 <div class="actions rollover-item pull-right">
  21.                     <a title="Click to learn how to bookmark/follow groups" href="https://community.rockrms.com/documentation/BookContent/7#groupfollowing">
  22.                         <i class="fas fa-info-circle"></i>
  23.                     </a>
  24.                     <a title="View groups I have bookmarked/followed" class="edit" href="/page/302"><i class="fa fa-cog"></i></a>
  25.                 </div>
  26.     </div>
  27.     <div class="panel-body">
  28.         <ul>
  29.             {% for item in results %}
  30.                 <li>
  31.                     <a href='/Group/{{ item.Id }}' style='padding-left:24px'>{{ item.Name }}</a>
  32.                 </li>
  33.             {% endfor %}
  34.         </ul>
  35.     </div>
  36. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement