protected void Page_Load(object sender, EventArgs e)
        {
            if (Sitecore.Context.Item.InheritsTemplate(DefaultArticlePageItem.TemplateId))
                ObjDefaultArticle = (DefaultArticlePageItem)Sitecore.Context.Item;

            if (ObjDefaultArticle != null)
            {
                //Show Author details
                if (ObjDefaultArticle.AuthorName.Item != null)
                {
                    frAuthorName.Item = ObjDefaultArticle.AuthorName.Item;
                    frAuthorImage.Item = ObjDefaultArticle.AuthorName.Item;
                    hlAuthorImage.Visible = true;
                    hlAuthorImage.NavigateUrl = ObjDefaultArticle.AuthorName.Item.GetUrl();
                    hlAuthorMorePost.Text = UnderstoodDotOrg.Common.DictionaryConstants.Articles_MorePostsbythisAuthorText;
                    hlAuthorMorePost.NavigateUrl = ObjDefaultArticle.AuthorName.Item.GetUrl();

                    AuthorItem author = (AuthorItem)ObjDefaultArticle.AuthorName.Item;

                    litBioSentence.Text = author.AuthorBioAbstract.Raw;
                }
                else
                    this.Visible = false;
            }
            else
                this.Visible = false;
        }
        public object ComputeFieldValue(IIndexable indexable)
        {
            var indexItem = indexable as SitecoreIndexableItem;
            if (indexItem == null)
            {
                return null;
            }
            var item = (Sitecore.Data.Items.Item)indexItem.Item;
            if (item == null)
            {
                return null;
            }

            // Skip non-articles
            if (!item.InheritsTemplate(DefaultArticlePageItem.TemplateId))
            {
                return null;
            }

            var article = new DefaultArticlePageItem(item);
            bool fieldMatch = true;
            CustomTreeListField target = null;

            // Only index the following fields
            switch (FieldName)
            {
                case UnderstoodDotOrg.Common.Constants.SolrFields.ChildDiagnoses:
                    target = article.ChildDiagnoses;
                    break;
                case UnderstoodDotOrg.Common.Constants.SolrFields.ChildGrades:
                    target = article.ChildGrades;
                    break;
                case UnderstoodDotOrg.Common.Constants.SolrFields.ChildIssues:
                    target = article.ChildIssues;
                    break;
                case UnderstoodDotOrg.Common.Constants.SolrFields.ApplicableEvaluations:
                    target = article.OtherApplicableEvaluations;
                    break;
                case UnderstoodDotOrg.Common.Constants.SolrFields.DiagnosedConditions:
                    target = article.DiagnosedCondition;
                    break;
                case UnderstoodDotOrg.Common.Constants.SolrFields.ImportanceLevels:
                    target = article.ImportanceLevel;
                    break;
                case UnderstoodDotOrg.Common.Constants.SolrFields.OverrideTypes:
                    target = article.OverrideType;
                    break;
                case UnderstoodDotOrg.Common.Constants.SolrFields.ParentInterests:
                    target = article.ApplicableInterests;
                    break;
                default:
                    fieldMatch = false;
                    break;
            }

            return fieldMatch ? GetSelectedItems(target) : null;
        }
        private void BindData(DefaultArticlePageItem page)
        {
            ActivityLog tempLog = new ActivityLog();
            //ContentId, ActivityValue
            int helpfulCount = tempLog.GetActivityCountByValue(new Guid(Sitecore.Context.Item.ID.ToString()), Constants.UserActivity_Values.FoundHelpful_True );

            lblHelpfulCount.Text = lblHelpfulCountMobile.Text = helpfulCount.ToString();

            ltlFoundThisHelpful.Text = ltlFoundThisHelpfulMobile.Text = DictionaryConstants.FoundThisHelpful;
        }
        private void BindData(Item thePage)
        {
            string BlogId = "";
            string BlogPostId = "";

            if (thePage.TemplateID.ToString() == DefaultArticlePageItem.TemplateId)
            {
                BlogId = new DefaultArticlePageItem(thePage).BlogId.Raw;
                BlogPostId = new DefaultArticlePageItem(thePage).BlogPostId.Raw;
            }
            else if (thePage.TemplateID.ToString() == BehaviorToolsAdvicePageItem.TemplateId)
            {
                BlogId = new BehaviorAdvicePageItem(thePage).BlogId.Raw;
                BlogPostId = new BehaviorAdvicePageItem(thePage).BlogPostId.Raw;
            }

            ActivityLog tempLog = new ActivityLog();
            //ContentId, ActivityValue
            int helpfulCount = tempLog.GetActivityCountByValue(new Guid(Sitecore.Context.Item.ID.ToString()), Constants.UserActivity_Values.FoundHelpful_True);
            int commentCount = 0;

            if (!string.IsNullOrEmpty(BlogId) && !string.IsNullOrEmpty(BlogPostId))
            {
                commentCount = CommunityHelper.GetTotalComments(BlogId, BlogPostId);
            }

            lblHelpfulCount.Text = lblHelpfulCountMobile.Text = helpfulCount.ToString();
            lblCommentCount.Text = lblCommentCountMobile.Text = commentCount.ToString();

            ltlFoundThisHelpful.Text = ltlFoundThisHelpfulMobile.Text = DictionaryConstants.FoundThisHelpful;

            string commentLabel = DictionaryConstants.PluralCommentLabel;
            if (commentCount == 1)
            {
                commentLabel = DictionaryConstants.SingleCommentLabel;
            }

            ltlComments.Text = ltlCommentsMobile.Text = commentLabel;
        }
public SlideshowArticlePageItem(Item innerItem) : base(innerItem)
{
	_DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);

}
public ToolkitArticlePageItem(Item innerItem) : base(innerItem)
{
	_DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);

}
public AssessmentQuizArticleItem(Item innerItem) : base(innerItem)
{
	_DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);

}
public SimpleExpertArticleItem(Item innerItem) : base(innerItem)
{
	_DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);

}
public KnowledgeQuizResultsArticlePageItem(Item innerItem) : base(innerItem)
{
	_DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);

}
public GlossaryPageItem(Item innerItem) : base(innerItem)
{
	_DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);

}
public AdvocacyArticlePageItem(Item innerItem) : base(innerItem)
{
	_DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);
	_AdvocacyBasePageItem = new AdvocacyBasePageItem(innerItem);

}
public InfographicArticlePageItem(Item innerItem) : base(innerItem)
{
	_DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);

}
public TextOnlyTipsArticlePageItem(Item innerItem) : base(innerItem)
{
	_DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);

}
public KnowledgeQuizQuestionArticlePageItem(Item innerItem) : base(innerItem)
{
	_DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);

}
public ChecklistArticlePageItem(Item innerItem) : base(innerItem)
{
	_DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);

}
public LandingPageResourceArticlePageItem(Item innerItem) : base(innerItem)
{
	_DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);

}
public ActionStyleListPageItem(Item innerItem) : base(innerItem)
{
	_DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);

}
public DeepDiveArticlePageItem(Item innerItem) : base(innerItem)
{
	_DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);

}
public VideoArticlePageItem(Item innerItem) : base(innerItem)
{
	_DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);

}
Example #20
0
 public string GetArticleType()
 {
     return(DefaultArticlePageItem.GetArticleType(InnerItem.TemplateID));
 }