Skip to main content

✖️Exit Impersonation on Custom Portal Pages

One challenge of using a custom portal that renders with "Framework - No Branding" is that the default "Impersonate" block that normally appears when you Impersonate a record... no longer appears. This can be frustrating and challenging - one drawback of that shiny new super-custom status portal may be "we lost the exit impersonate button!" But no fear! We can fix it.

Just add a new Static Content Block with the following HTML to your portal (lifted from using F12 inspect):

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title></title>
  </head>
  <body>
    <div role="banner" style="background-color: #efefef; font-size: 16px; margin: -5px 0 15px 0; position: relative;">
      <div class="dialog_close" data-clickable="1" data-href="/account/logout?r=/manage/lookup/?id={{personGUID}}" onclick="FW.Navigate(this);" style="top: 5px; right: 5px;" tabindex="0" title="Exit Impersonation">
      </div>
      <div style="padding: 7px 15px;">
        {{preferred}} {{last}}
        <div style="font-size: 14px; position: absolute; right: 25px; top: 7px;">
          {{studentID}}
        </div>
        <div style="color: #666666; font-size: 11px; margin-top: 3px; text-align: center;">
          <strong>Impersonation Active: </strong> You may be able to see data and make changes that the user might not be able to see or do directly. Avoid impersonating multiple records simultaneously in a single browser session.
        </div>
      </div>
    </div>
  </body>
</html>

And add a simple Exists filter to the Static Content by joining to "Current User".

image.png
Don't forget to make sure any merge fields you wish to use are linked in your portal queries/method - this array of merge fields is designed to replicate the default design, but you can customize it further.

image.png

This new custom impersonate block will now appear on your "No Branding" portal pages when a logged in user is "impersonating" a record - and will not show to the record during a normal session.