orchardcms - Can I render all zones to an HTML string in a controller method -


i'm trying render html content item string within controller action. technically want "body" part of without header/footer stuff. want can content item rendering way want once, , display normal orchard page or requesting html content item via ajax display in div in javascript app. don't want have manually render in javascript duplicating layout logic did. want re-use bulk of server side rendering changes reflected in normal orchard page , javascript page. i've been digging code , searching everywhere , have gotten close not way there.

i found these:

how render shape string?

using findview in orchard

in controller have:

var shape = _contentmanager.builddisplay(contentitem);

using either of 2 methods above, can render shape html string in controller. golden. getting body of page , using in js. then, changed placement file:

<place parts_common_body="content:1" />

was changed to:

<place parts_common_body="/asidefirst:1" />

the body moved wanted (asidefirst) in normal orchard page disappeared html retrieved using 2 methods above.

if @ shape.content.items after builddisplay call, can see item body no longer there... why not rendering zones? or, guess more specific question why builddisplay method not building complete shape? there way can make work?

i tried million different things , got working. not sure totally yet, think problem had fact using shape.content , i'd moved stuff out of content zone. , maybe when looking @ builddisplay method returning not looking @ newly created zone did had stuff thought missing. need learn more zones , shapes... anyway, have new zone called "maininfo" created in placement file. maininfo property on main shape returned form builddisplay , pass shape.maininfo view rendering code , seems working now.


Comments