Couldn't able to add flow part widgets in the landing page
I am trying to add a Flowpart in the landing page but not showing the section of selected widget in preview and also in saved landing page content view. I have tried below process to add flowpart on landing page -
- First added flow part in the landing page content type.
- than trying to add a new landing page with the HTML widget flow part.
- than click on preview but not showing the added widget in landing page.
I have the same issue on standard themes or custom I verified on https://try.orchardproject.net/. Is this supposed work?
If you use the default shape template views, all parts / fields of a given content item will be rendered. But when a shape is overridden e.g by a theme, you have to look in the related view template code.
E.g TheBlogTheme/Views/Content-Article.liquid is not using the standard way to render child content zones as you can see in OC.Contents/Views.Content.cshtml. Instead it explicitly grabs data from Model.ContentItem.Content (which is a JObject as it is persisted in the database) and parts / fields from Model.Content e.g Model.Content.HtmlBodyPart (which is a shape that you can render with shape_render).
For the TheAgencyTheme it is the same but the template code is in the database, so through the admin you have to look in the Templates page and edit the LandingPage to see how e.g each BagPart is rendered, and then you have to add some code to render e.g a FlowPart.
Thank you for the info @jtkech? This will help us update our custom theme. ? Will OC be updating the agency theme to allow the FlowPart by default? We could add it and do a PR if so.
Sorry, i don't think so, you would have to render it by yourself, e.g by just adding in the LandingPage database template => {{ Model.Content.FlowPart | shape_render }} (need to be tried).
Then you will be able to override the default FlowPart.cshtml and the widgets as needed. Overriding in liquid the default FlowPart.cshtml would not be easy, but it only adds a <section class="flow"> and then renders all widgets that are easier to override.
You can override a widget template with a Widget-TheWidget.liquid file (or a razor file but your theme would need a _ViewImports and so on) or through the admin with a database template named, as i remember, Widget_TheWidget or Widget__TheWidget.
This could be the purpose of an article related to Flow Part, how to render it and customize the widget templates. There is not much that can be done generically here in this theme.