예제 #1
0
        public static OrchardTagBuilder AddCommonElementAttributes(this OrchardTagBuilder tagBuilder, dynamic shape)
        {
            var attributes = GetCommonElementAttributes(shape);

            tagBuilder.MergeAttributes(shape.Attributes);
            tagBuilder.MergeAttributes(attributes);
            return(tagBuilder);
        }
예제 #2
0
        public OrchardTagBuilder Create(dynamic shape, string tagName)
        {
            // Identical to supressed version except following line looks for a tag name in the shape:
            var tagBuilder = new OrchardTagBuilder(shape.TagName == null ? tagName : (string)shape.TagName);

            tagBuilder.MergeAttributes(shape.Attributes, false);
            foreach (var cssClass in shape.Classes ?? Enumerable.Empty <string>())
            {
                tagBuilder.AddCssClass(cssClass);
            }
            if (!string.IsNullOrEmpty(shape.Id))
            {
                tagBuilder.GenerateId(shape.Id);
            }
            return(tagBuilder);
        }