What

This recipe will show you how to:

Add a second impersonation Action on the Actions Tab. This custom action will redirect to another page with a secondary bio block that has impersonation configured to a alternate start page.

Screenshot_2022-08-03_161235.jpg

Why

As an admin I have a need to impersonate staff and volunteers on our internal Rock portal and on our congregant facing website called My College Church. The impersonation bio block only allows you to set one impersonation start page.

How

  1. Setup a new page with a parent of Support Pages with the name Impersonate User on Public Site and layout of PersonDetail.
Impersonate User on Public Site Page Setup
  1. Under Advanced Settings set a page route of ImpersonatePersonPublic/{PersonId} and Person Parameter Name of PersonId
  2. Add a Person Bio block to the IndividualDetail zone
  3. Enable Impersonation on the new person bio block
  4. Set the Impersonation Start Page as desired.
  5. Optional: Add the script below somewhere on the page. I chose to add it in a separate html block. This script will use jquery to click the impersonate action after the page is loaded. Note: After you do this you will only be able to edit this page using the Pages page.

<script>
    // Handler for .ready() called.
    $(function() {
        $('a[id$="lbImpersonate"]')[1].click();
    });
</script>
Primary Person Bio Block Setup
  1. Navigate to a person profile page
  2. Edit the Person Bio block Additional Custom Actions setting and add this line:
<li><a href="/ImpersonatePersonPublic/{0}"><i class="fa-fw fa fa-unlock"></i> Impersonate on Public Site</a></li>

Follow Up

Please don't hesitate to leave a comment or message me on Rocket Chat (@tony.visconti) if you have questions or find any issues with this recipe.

The Rock community site doesn't currently notify recipe authors when you comment below. You can upvote comment notifications here.

Change Log

~2023-08 Initial Version