How to wrap few shapes to one div?

Topics: General, Writing themes
Jul 24, 2012 at 3:22 PM
Edited Jul 24, 2012 at 3:42 PM

I want to wrap few content parts into one div.
Now I'm solving this by following way:
I have created Content-TripRoute.cshtml to overload content rendering of my type TripRoute.

    @{ var shapes = (IEnumerable<dynamic>)Model.Content.Items; }
        <div>
            @Display(shapes.First(x => x.Metadata.Type == "Parts_TripRoutePart"));
            @Display(shapes.First(x => x.Metadata.Type == "Parts_TripRoutePart_Map"));
        </div>
        <div>
            @Display(shapes.First(x => x.Metadata.Type == "Parts_FullDescriptionPart"));
        </div>


Is it a right way to wrap few shapes to one div?

Jul 24, 2012 at 3:38 PM

Can't answer your question, but your code snippet could come in handy - thanks ;)

Coordinator
Jul 24, 2012 at 5:41 PM
Edited Jul 24, 2012 at 5:42 PM

Yes. It's more or less what I was showing in this post: http://weblogs.asp.net/bleroy/archive/2011/07/31/so-you-don-t-want-to-use-placement-info.aspx

Of course once you've done that you can't use placement.

Jul 26, 2012 at 11:03 AM

Thanks, Bertrand, it is what I'm looking for.