Example #1
0
        public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable <Attribute> attributes)
        {
            var parent = metadata.FindTopMostContentMetadata();

            if (parent != null)
            {
                var parentType = parent.Model.GetOriginalType();
                this.EditorConfiguration["context_parentType"] = parentType.Name;
                this.EditorConfiguration["context_link"]       = ((IContent)parent.Model).ContentLink;           // it will be empty for local block creating in ContentArea
            }

            base.ModifyMetadata(metadata, attributes);
        }
Example #2
0
        public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable <Attribute> attributes)
        {
            base.ModifyMetadata(metadata, attributes);

            ExtendedMetadata extendedMetadatum = metadata.FindTopMostContentMetadata();

            IContent model;

            if (extendedMetadatum != null)
            {
                model = extendedMetadatum.Model as IContent;
            }
            else
            {
                model = null;
            }
            metadata.ClientEditingClass = "alloy/editors/ExtendedTinyMCEEditor";
            metadata.EditorConfiguration.Add("parentValue", parentValue(model, metadata.PropertyName));
        }