Beispiel #1
0
        public string GetValue(IIndexable indexable, string fieldName, TemplateID templateId)
        {
            var item = indexable.ToItem();

            if (item == null)
            {
                return(null);
            }
            if (item.IsNotMasterOrWebIndex())
            {
                return(null);
            }
            if (!item.IsContentOrMediaItem())
            {
                return(null);
            }

            if (!item.InheritsFromTemplate(templateId))
            {
                return(null);
            }

            var title = item.GetFieldValue(fieldName);

            return(title.ToValueOrNull());
        }
        public override object ComputeFieldValue(IIndexable indexable)
        {
            IndexedItem = indexable.ToItem();

            if (ShouldProcess)
            {
                return(this.ExecuteComputeFieldValue(indexable));
            }

            return(null);
        }
        public object ComputeFieldValue(IIndexable indexable)
        {
            var item = indexable.ToItem();

            if (item == null)
            {
                return(null);
            }
            if (item.IsNotMasterOrWebIndex())
            {
                return(null);
            }

            return(item.IsMediaItem());
        }
        /// <summary>
        /// Get the content or media Item of this indexable, or null if not found.
        /// </summary>
        /// <param name="indexable"></param>
        /// <returns></returns>
        public static Item Get(IIndexable indexable)
        {
            var item = indexable.ToItem();

            if (item == null)
            {
                return(null);
            }
            if (item.IsNotMasterOrWebIndex())
            {
                return(null);
            }
            if (!item.IsContentOrMediaItem())
            {
                return(null);
            }

            return(item);
        }
        public string GetValue(IIndexable indexable, string[] fieldNames, TemplateID templateId)
        {
            var item = indexable.ToItem();

            return(GetValue(item, fieldNames, templateId));
        }