Best way to dynamically add shape to "BlogPost" content item?

Topics: General, Writing modules
Oct 16, 2012 at 6:40 PM

I want to dynamically add a shape to the BlogPost content item. It seems there are two approaches: 

1. IShapeTableProvider, something like this: 

                .OnCreated(created => {
                    created.Shape.SyntaxHighlighter = Shape.SyntaxHighlighter(hello: "hello");

2. Create a part, driver, and hook up the part to "BlogPost" via an ActivatingFilter in my part's Handler. 


I went with #2 for no reason other than I was already familiar with displaying shapes in that manner. But I think method 1 might have been more succinct.

What are the differences between the two methods? My shape doesn't take in any data, and the part doesn't have a corresponding database record, it just renders static script tags to blog posts.


Oct 16, 2012 at 7:12 PM

You summed it up well. I'd go for #1 because it's so much easier and succinct.