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)

Jasmin Savard
@Skrypt
Let's say Module B is Newtonsoft.Json
Of course it won't be listed in the Admin UI as a feature
Josiah Nunemaker
@JosNun
Orchard core module (Etch.OrchardCore.Fields in particular)
Jasmin Savard
@Skrypt
Then the Etch.OrchardCore.Fields module need to be referenced in the web project too.
Because what you are doing is extending this module with your own
So both should be enabled features in Orchard
But if you add a dependency on Etch.OrchardCore.Field in your custom module then it will automatically enable it.
Josiah Nunemaker
@JosNun
Gotcha. So anywhere I need to use my module (Module A), I'll also have to add a package reference to Module B, then.
Jasmin Savard
@Skrypt
In the web project yes.
Josiah Nunemaker
@JosNun
That almost makes it feel less modular? I can see why that is a requirement, though. Thanks for the help!
Jasmin Savard
@Skrypt
We don't harvest OC modules dependencies. We maybe should.
So basically, a dependency for all the OC modules are needed on the web project so that they get harvested and that the startup.cs file be hit.
Josiah Nunemaker
@JosNun
Gotcha
Jasmin Savard
@Skrypt
Else, you create a dependency on a module but the DI doesn't know about it
Josiah Nunemaker
@JosNun
yeah, which isn't ideal
Jasmin Savard
@Skrypt
Well, maybe we could enhance this part but at the same time... we don't want this to be recursive
Else you could have Module A referencing Module B referencing Module C referencing Module A
And then the DI would not be happy about it
So, I think it's fine how it is
avojacek
@avojacek
hi all is it possible to define different content part for different users. I do not know if it make sense, but when I want to let some people edit content of blog post using html wysiwyg editor, but another user want to use markdown?
Jasmin Savard
@Skrypt
@avojacek Not possible.
avojacek
@avojacek
@Skrypt thank you. I have another question :-) If I do hadless orchad and then create frontend I saw, that I can use OpenID connect to authenticate frontend app to run GraphQL queries. But how to authenticate users on frontend?
Jasmin Savard
@Skrypt
You mean how to login?
23 replies
Niraj Soni
@ns8482e
Is there built-in way to display Numeric field as currency? i.e prefixed with $?
31 replies
Rustem
@rserj
image.png
21 replies
Hello, can I display Nested/Conditional fields somthing like this?
Steven Spits
@netwavebe

Is there a way in OC to get the html of a content item using a specific displayType in a controller?
I tried this:

var productShape = await _contentItemDisplayManager.BuildDisplayAsync(product, this, "Detail");
var productHtml = await displayHelper.ShapeExecuteAsync(productShape);

This works, but productHtml also includes the theme html, which I do not want. Any ideas?

Niraj Soni
@ns8482e
check productShape.Content it will have html you need
Jasmin Savard
@Skrypt
What you mean by theme html? You mean the admin theme styles?
The BuildDisplayAsync will use whatever templates you implemented in your own theme too.
Small screenshot would help
Sébastien Ros
@sebastienros
@netwavebe definitely there is a way ... trying to remember
Sébastien Ros
@sebastienros
I know !!!!!
Steven Spits
@netwavebe
@Skrypt productHtml includes the frontend theming (a complete page) but I want only the fragment rendered by one product.
@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