Lombiq/Helpful-Extensions

Flows Helpful Extensions - AdditionalStylingPart does not add the widget classes

AntonySandoval opened this issue ยท 11 comments

Hello Lombiq team,

I am using the Flows Helpful Extensions feature, and I realized when this feature is enabled and there were content items with widgets already created, thus these content items do not have the AdditionalStylingPart yet, so the classes widget and widget-{ContentType} are not added, and the widgets are rendered incorrectly in the view without those classes.

One solution is to re-publish the content items so they become aware of the AdditionalStylingPart and render correctly, but in an existing site with many content items, this solution does not seem reasonable.

For now, I made a little change in the view Lombiq.HelpfulExtensions.Flows.FlowPart.cshtml trying to follow the original logic to solve this issue. I already tested it in the Open-Source-Orchard-Core-Extensions solution and in my own project, and it is working well. You can check it out here in this fork repo and please let me know if you have any comment or suggestion on it, or if there is another better solution to go for. I would be glad to contribute to the solution and create a pull request if it suits you well and you consider it that way.

Thank you for your contribution, Antony! It looks good at the first glance, please submit a PR.

BTW you might be interested to sign up for the DotNest Core beta and use Helpful Extensions there: https://dotnest.com/blog/the-orchard-core-version-of-dotnest-is-coming-sign-up-for-the-beta-here

Thank you for your contribution, Antony! It looks good at the first glance, please submit a PR.

You're welcome! Sure. This is the PR for the change.

BTW you might be interested to sign up for the DotNest Core beta and use Helpful Extensions there: https://dotnest.com/blog/the-orchard-core-version-of-dotnest-is-coming-sign-up-for-the-beta-here

Cool! Thank you for the info and invitation.

Thank you! If you find any other issues with this or one of our other projects then I'd be happy to review other contributions of yours too.

Absolutely! You are welcome. I'd be glad to continue contributing. I appreciate you created and shared these Helpful Extensions for Orchard and Orchard Core projects. Thanks for that!

Did you work on anything else related to Orchard Core, BTW?

Hi @Piedone ! I hope you are doing well.
I'm sorry for the delay in my reply. I haven't had the chance to continue working on something related to Orchard Core in the last two months or so.
But this week I returned to work on a feature for an Orchard Core project. And I'm still interested in the Orchard Core projects and related topics.

BTW, I'm working on a report following the usual .net core MVC stuff with EF Core, but inside an Orchard Core project, and I would like to render that view using the admin layout and menu, in order to allow a back office user feeling like he/she is still in the administration portal of the site. Do you know if there is any option to achieve something like that?

I cannot override the Layout property in the view because it gives me the error:

InvalidOperationException: RenderBody has not been called for the page at '/Areas/TheAdmin/Views/Layout.cshtml'. To ignore call IgnoreBody().

And it seems that it is because Orchard Core uses precompiled layout.
Thanks in advance.

I'm glad to hear you're back to Orchard, Antony!

You just need to create an admin controller: https://github.com/Lombiq/Orchard-Training-Demo-Module/blob/dev/Controllers/AdminController.cs

Thanks @Piedone! It worked like a charm. That was what I was looking for.

Great then!