/// <summary>
        /// Shows the list.
        /// </summary>
        public void ShowList()
        {
            using (var rockContext = new RockContext())
            {
                var channelQry = new InteractionChannelService(rockContext)
                                 .Queryable().AsNoTracking();

                var channelMediumValueId = gfFilter.GetUserPreference(MEDIUM_TYPE_FILTER).AsIntegerOrNull();
                if (channelMediumValueId.HasValue)
                {
                    channelQry = channelQry.Where(a => a.ChannelTypeMediumValueId == channelMediumValueId.Value);
                }

                // Parse the default template so that it does not need to be parsed multiple times
                var defaultTemplate = Template.Parse(GetAttributeValue("DefaultTemplate"));
                var options         = new Rock.Lava.CommonMergeFieldsOptions();
                options.GetPageContext             = false;
                options.GetLegacyGlobalMergeFields = false;

                var mergeFields = Rock.Lava.LavaHelper.GetCommonMergeFields(this.RockPage, this.CurrentPerson, options);
                mergeFields.Add("ComponentListPage", LinkedPageRoute("ComponentListPage"));
                mergeFields.Add("SessionListPage", LinkedPageRoute("SessionListPage"));

                var channelItems = new List <ChannelItem>();
                foreach (var channel in channelQry)
                {
                    if (!channel.IsAuthorized(Authorization.VIEW, CurrentPerson))
                    {
                        continue;
                    }

                    var channelMergeFields = new Dictionary <string, object>(mergeFields);
                    channelMergeFields.Add("InteractionChannel", channel);

                    string html = channel.ChannelListTemplate.IsNotNullOrWhitespace() ?
                                  channel.ChannelListTemplate.ResolveMergeFields(channelMergeFields) :
                                  defaultTemplate.Render(Hash.FromDictionary(channelMergeFields));

                    channelItems.Add(new ChannelItem
                    {
                        Id          = channel.Id,
                        ChannelHtml = html
                    });
                }

                rptChannel.DataSource = channelItems;
                rptChannel.DataBind();
            }
        }
        /// <summary>
        /// Shows the list.
        /// </summary>
        public void ShowList()
        {
            using (var rockContext = new RockContext())
            {
                var channelQry = new InteractionChannelService(rockContext)
                                 .Queryable().AsNoTracking();

                var channelMediumValueId = gfFilter.GetUserPreference(MEDIUM_TYPE_FILTER).AsIntegerOrNull();
                if (channelMediumValueId.HasValue)
                {
                    channelQry = channelQry.Where(a => a.ChannelTypeMediumValueId == channelMediumValueId.Value);
                }

                if (!cbIncludeInactive.Checked)
                {
                    channelQry = channelQry.Where(a => a.IsActive);
                }

                if (!string.IsNullOrWhiteSpace(GetAttributeValue("InteractionChannels")))
                {
                    var selectedChannelIds = Array.ConvertAll(GetAttributeValue("InteractionChannels").Split(','), s => new Guid(s)).ToList();
                    channelQry = channelQry.Where(a => selectedChannelIds.Contains(a.Guid));
                }

                var personId = GetPersonId();
                if (personId.HasValue)
                {
                    var interactionQry = new InteractionService(rockContext).Queryable();
                    channelQry = channelQry.Where(a => interactionQry.Any(b => b.PersonAlias.PersonId == personId.Value && b.InteractionComponent.InteractionChannelId == a.Id));
                }

                // Parse the default template so that it does not need to be parsed multiple times.
                Template      defaultTemplate     = null;
                ILavaTemplate defaultLavaTemplate = null;

                if (LavaService.RockLiquidIsEnabled)
                {
                    defaultTemplate = Template.Parse(GetAttributeValue("DefaultTemplate"));

                    LavaHelper.VerifyParseTemplateForCurrentEngine(GetAttributeValue("DefaultTemplate"));
                }
                else
                {
                    var parseResult = LavaService.ParseTemplate(GetAttributeValue("DefaultTemplate"));

                    defaultLavaTemplate = parseResult.Template;
                }

                var options = new Rock.Lava.CommonMergeFieldsOptions();
                options.GetPageContext             = false;
                options.GetLegacyGlobalMergeFields = false;

                var mergeFields = Rock.Lava.LavaHelper.GetCommonMergeFields(this.RockPage, this.CurrentPerson, options);
                mergeFields.Add("ComponentListPage", LinkedPageRoute("ComponentListPage"));
                mergeFields.Add("SessionListPage", LinkedPageRoute("SessionListPage"));

                var channelItems = new List <ChannelItem>();

                if (LavaService.RockLiquidIsEnabled)
                {
                    foreach (var channel in channelQry)
                    {
                        if (!channel.IsAuthorized(Authorization.VIEW, CurrentPerson))
                        {
                            continue;
                        }
                        var channelMergeFields = new Dictionary <string, object>(mergeFields);
                        channelMergeFields.Add("InteractionChannel", channel);

                        string html = channel.ChannelListTemplate.IsNotNullOrWhiteSpace() ?
                                      channel.ChannelListTemplate.ResolveMergeFields(channelMergeFields) :
                                      defaultTemplate.Render(Hash.FromDictionary(channelMergeFields));

                        channelItems.Add(new ChannelItem
                        {
                            Id          = channel.Id,
                            ChannelHtml = html
                        });
                    }
                }
                else
                {
                    foreach (var channel in channelQry)
                    {
                        if (!channel.IsAuthorized(Authorization.VIEW, CurrentPerson))
                        {
                            continue;
                        }
                        var channelMergeFields = new Dictionary <string, object>(mergeFields);
                        channelMergeFields.Add("InteractionChannel", channel);

                        string html = channel.ChannelListTemplate.IsNotNullOrWhiteSpace() ?
                                      channel.ChannelListTemplate.ResolveMergeFields(channelMergeFields) :
                                      LavaService.RenderTemplate(defaultLavaTemplate, channelMergeFields).Text;

                        channelItems.Add(new ChannelItem
                        {
                            Id          = channel.Id,
                            ChannelHtml = html
                        });
                    }
                }

                rptChannel.DataSource = channelItems;
                rptChannel.DataBind();
            }
        }