Render a template conditionally #7516
Unanswered
TheoStefou
asked this question in
Q&A
Replies: 2 comments
-
The better solution is to find the template file and the block that contains your target code and then load your content there conditionally. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Yeah, overriding full views in CKAN is still not a perfect experience, so doing what you want to do requires some work. Some thoughts:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How would I take control of a template and add my custom logic to it? What I mean is the following:
Let's say I want to add some extra logic to the resource template before it is rendered. If my check passes, I want the default resource template to be rendered, otherwise my custom "error template" is rendered.
The problem is that I cannot just add a blueprint that "overrides" the path to resources, because then I would not be able to pass the correct parameters to the default resource template if my check passes. Redirecting to the resource path would just cause an infinite amount of redirects because my own blueprint would have control over the resource url.
The flow would be something like this:
Beta Was this translation helpful? Give feedback.
All reactions