Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 12 2020 01:41

    jtkech on patch-1

    (compare)

  • Apr 12 2020 01:39

    jtkech on patch-1

    Update ZoneShapes.cs (compare)

Steven Spits
@netwavebe
@sebastienros I'm all ears! :-D
Sébastien Ros
@sebastienros
we had [Themed(false)] on the action in O1, there is something like this also in OC but can't find it
maybe it's done in a more clever way, but I don't remember, and that must be me who implemented it, such a shame
Niraj Soni
@ns8482e
If you are using MVC, you can set Layout = null
Steven Spits
@netwavebe
@sebastienros I found this OrchardCMS/OrchardCore#5687 but I'm not sure what you mean by saying just use the shape you created.
Sébastien Ros
@sebastienros
right, the issue is that the shape you use is created by BuildDisplay, like in the sample I provided on the issue
so this shape will have the layout on it, because that's what content item shapes do, inject stuff in layout zones
if you use Summary, you don't have the Layout I assume?
Steven Spits
@netwavebe
Let me try this
Looks the same
Sébastien Ros
@sebastienros
got an idea. In your controller, pass the shape to the view as the model
in the view call await DisplayAsync(Model)
but also add this at the top: @{ ThemeLayout = null; }
Steven Spits
@netwavebe
@sebastienros That would probably work, but is not useful in my case. I'm trying to do this in an api controller. Need to return JSON: products with data and some html fragments.
Sébastien Ros
@sebastienros
I made a graphql endpoint for rendering content items, maybe the solution is there
can't remember if there was layout or not included in it
looking for it...
Niraj Soni
@ns8482e
Create theme selector based on RequestPath
Steven Spits
@netwavebe
@ns8482e Feels really hacky. It shouldn't be this hard to get the html fragment a single content item would render (assuming it's not using zone/placement/...).
Sébastien Ros
@sebastienros
I believe the theme is not applied if it's not a controller. Can you try putting your code in a middleware endpoint?
or we might have to implement this Themed(false) attribute. Not hard though, it would set a scoped property that is checked where the layout is applied. Or it could use a Theme selector and this attribute
Steven Spits
@netwavebe
@sebastienros Moving it to a service and injecting all services is not enough. But of course it's still the controller calling this service.
@sebastienros Much harder than I anticipated, might be better to look at other solutions (send everything as data and make a similar template in Angular).
Niraj Soni
@ns8482e
another option is to implement ActionFilter
and assign Theme to null for RazorViewFeature
Jasmin Savard
@Skrypt
@sebastienros Yes it renders the entire layout
The GraphQL render method
Niraj Soni
@ns8482e
I have same issue with BlazorServer
Jasmin Savard
@Skrypt
So BuildDisplayAsync does what I thought. It renders all the small pieces from .cshtml templates. So, it's just about rendering the HTML and Body tags or not.
But at the same time then, some things might not work if you want a script rendered at header.
Because we render these scripts and styles on the header of the page.
So, returning the content of the BuildDisplayAsync without theming or scripts but if you have scripts that are rendered at head then you don't have a Layout to include them after the Body tag for example.
So, I guess in that case the best option is to use an alternate Layout
Jasmin Savard
@Skrypt
Which doesn't contain any HTML and Body tag.
Jasmin Savard
@Skrypt
Okay then from a GraphQL API call then you can parse the DOM result and keep only everything inside the Body tag since you might be requesting this from a javascript call.
Or we should be able to pass a param that says use X layout.
Jasmin Savard
@Skrypt
I think @sebastienros knows what to do here
Steven Spits
@netwavebe
@sebastienros @Skrypt I'll continue this in OrchardCMS/OrchardCore#5687
CrestApps
@CrestApps
Is there a helper to create a link for listing a specific content type?
1 reply
Jasmin Savard
@Skrypt
cors?
1 reply
CrestApps
@CrestApps
Is there a reason why typeof(Controller) instead of ControllerBase? https://github.com/OrchardCMS/OrchardCore/blob/339d74b251b53393dd510f8ad3027aa17d78500d/src/OrchardCore/OrchardCore.Mvc.Core/Utilities/ControllerTypeExtensions.cs#L10 . When creating an API controller, one would using ControllerBase not Controller
Josiah Nunemaker
@JosNun
Is it possible to have a content item with "child" content items? In my case, I want all the configuration for a multi-step process to be in one location, but don't necessarily want all the fields on one page.
11 replies
Sébastien Ros
@sebastienros

@/all we have released on the cloudsmith feed the packages that we intend to ship for 1.1.0.
To test them you need to add this url in your nuget.config with <add key="OrchardCore" value="https://nuget.cloudsmith.io/orchardcore/preview/v3/index.json" /> , and reference OrchardCore packages with version 1.1.0-preview-16522

As soon as enough people have verified these packages work, I'll publish them on NuGet.
Testing means going through the Setup, testing some features work, and ensuring our guides from the documentation work too.

Thanks

Jasmin Savard
@Skrypt
:rocket:
Andrii Chebukin
@xperiandri
👏👏👏
Any thoughts?
Josiah Nunemaker
@JosNun
Judging by this Issue, OrchardCMS/OrchardCore#6784 would I be correct in assuming that there's currently no way to place a named part with a placement?
13 replies
Antoine Griffard
@agriffard
http://try.orchardcore.fr/ now running on 1.1.0-preview-16522 if you want to test.