Skip to content

How can I display a shape on demand using a predefined driver? #6870

Answered by Piedone
MikeAlhayek asked this question in Q&A
Discussion options

You must be logged in to vote

A basic idea in Orchard is that content types are a composition of independent parts. It seems to me that you're attempting to make one part depend on another one. Since you can't really rely on parts being evaluated (like displayed) in a particular order, I encourage you to change how you approach this task. Can you tell what exactly are you trying to achieve?

That being said, here are a few ideas:

  • Display() in the driver can return null based on the part's content or anything else.
  • Instead of trying to render PropertyTypePart's shape in FancyFormPart you can render an ad-hoc shape there directly (if you want to factor that piece of markup out).
  • You can just override the whole Content s…

Replies: 5 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by MikeAlhayek
Comment options

MikeAlhayek
Aug 10, 2020
Collaborator Author

You must be logged in to vote
7 replies
@Piedone
Comment options

@MikeAlhayek
Comment options

MikeAlhayek Aug 10, 2020
Collaborator Author

@Piedone
Comment options

@MikeAlhayek
Comment options

MikeAlhayek Aug 10, 2020
Collaborator Author

@Piedone
Comment options

Comment options

You must be logged in to vote
1 reply
@Piedone
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants