Avatars

Rock's avatar feature provides the ability to create unique avatar images for each person record within the system.

Rock's avatar feature provides the ability to create unique avatar images for each person record within the system. This feature allows churches to easily identify members and visitors by providing a visual representation of each person, making it easier to connect with them and personalize interactions. The avatar images generated by Rock RMS are dynamic and customizable, allowing churches to choose from a range of styles and settings to best fit their needs. Enough talk though, let's look at how it works.

Note: The avatar feature requires Rock v15 or later.

Types of Avatars

There are two primary types of avatars: icons and initials. Each of these types are described below with details of each of their options.


Initials Avatar

Icon Avatar

Common Settings

All avatars share several settings. These settings are outlined below.


Style The style of the icon to use.
Samples 
    <img src="/GetAvatar.ashx?Style=initials&Text=TD" />
    <img src="/GetAvatar.ashx?Style=icon" />
Size The size parameter determines how large the resulting image file will be. The default value is 128px. It's best not to change this unless you need a larger avatar as the results are cached. Keep in mind that you'll want your results file to be 2x the size of the image to support high DPI displays.

Another common size to use is 400px as this is what's on the person profile page. These images are also cached with a consistent foreground and background color. If you'd like to use these cached images be sure your settings match the size and color.

Sample <img src="/GetAvatar.ashx?Style=initials&Text=TD&Size=40" />
PhotoId In most cases you'll want to display the individual's photo when one exists. To be able to do that we'll need to pass in the PhotoId of the individual.
Sample <img src="/GetAvatar.ashx?PhotoId=43655" />
BackgroundColor The background color to use when there is no profile photo. If you only provide the background color without the foreground color a matching foreground color will be calculated for you. Be sure to not include the # symbol in the color.
Sample <img src="/GetAvatar.ashx?BackgroundColor=ee7625&Text=TD" />
ForegroundColor The foreground color to use when there is no profile photo. If you only provide the foreground color without the background color a matching background color will be calculated for you. Be sure to not include the # symbol in the color.
Sample <img src="/GetAvatar.ashx?ForegroundColor=ee7625&Text=TD" />

Radius The border radius to use for rounding the corners. Use the value of 'circle' to make this a perfect circle. In most cases you'll want to do this with CSS, but in certain use cases like HTML email this is a handy option.
Samples 
    <img src="/GetAvatar.ashx?Radius=8&Text=TD&Size=40" />
    <img src="/GetAvatar.ashx?Radius=circle&Text=TD&Size=40" />
PersonId If you pass in a person Id to the avatar it will provide all of the needed configuration for you (gender, photo id and age classification). This is a slower way of loading the avatar as it does need to query the database on each load (caching is only considered after the database load to ensure newer profile images are respected).
Sample <img src="/GetAvatar.ashx?PersonId=5" />
PersonGuid If you pass in a person Guid to the avatar it will provide all of the needed configuration for you (gender, photo id and age classification). This is a slower way of loading the avatar as it does need to query the database on each load (caching is only considered after the database load to ensure newer profile images are respected).
Sample <img src="/GetAvatar.ashx?PersonGuid=8e0de326-4d3f-41e8-841a-c69750ec14aa" />
RefreshItemCache Set this value to true to clear the server cache for the specific avatar configuration. This requires that the current person is in either the [RSR- Rock Administrators] or [RSR - Web Administrators] roles.
Sample <img src="/GetAvatar.ashx?Style=initials&Text=TD&RefreshItemCache=true" />
RefreshCache Set this value to true to clear the entire avatar server cache. This requires that the current person is in either the [RSR- Rock Administrators] or [RSR - Web Administrators] roles.
Sample <img src="/GetAvatar.ashx?Style=initials&Text=TD&RefreshCache=true" />

Initials Avatar Settings

Below are settings for avatars using initials.

Text This is the text to use for the initials. Only the first two characters will be use..
Sample <img src="/GetAvatar.ashx?Text=SM" />

Icon Avatar Settings

Below are settings for avatars using the icon style.



Gender This determines what gender icon to show.
Samples 
    <img src="/GetAvatar.ashx?Style=icon&Gender=0" /> 
    Unknown
    <img src="/GetAvatar.ashx?Style=icon&Gender=1" /> 
    Male
    <img src="/GetAvatar.ashx?Style=icon&Gender=2" /> 
    Female
You can also provide the values of 'Male', 'Female' or 'Unknown' instead of the integer values.


Age Classification This determines what age classification the icon should be.
Samples 
    <img src="/GetAvatar.ashx?Style=icon&Gender=1&AgeClassification=0" /> 
    Unknown
    <img src="/GetAvatar.ashx?Style=icon&Gender=1&AgeClassification=1" /> 
    Adult
    <img src="/GetAvatar.ashx?Style=icon&Gender=1&AgeClassification=2" /> 
    Child

RecordTypeId This displays a different icon for people and businesses. You only need to provide this if you think you will have businesses in your data. Note the your values for RecordTypeId will be different from server to server.
Samples 
    <img src="/GetAvatar.ashx?Style=icon&RecordTypeId=1" /> Person
    <img src="/GetAvatar.ashx?Style=icon&RecordTypeId=2" /> Business

Tips

Below are some tips to keep in mind as you work with avatars.

  1. For simplicity the Person model's PhotoUrl provides you the proper URL for an individual. You can customize this URL by appending additional parameters to it.
  2. If no color (background or foreground) is provided a random color will be used. This will mean that each avatar will have a different color.
  3. The images will be set to cache for 7 days on the client.
  4. Keep in mind that the avatars are cached on the server based on the parameters you provide in the query string. Limit the number of unique configurations to reduce the number of stored files. For example it's best not to provide a large number of different sizes of avatars. For the most part use the default 128px size.