Render partial via config variable
See original GitHub issueI was hoping to use some config data (YAML) to dynamically specify another partial to render/include.
Handlebars’ documentation suggests this is possible, like so:
{{> (lookup . 'myVariable') }}
See: http://handlebarsjs.com/partials.html
This however results in The partial could not be found
.
I also found #195 and #239 regarding this.
I tried using the ‘workaround’ specified here but no luck: https://github.com/frctl/fractal/issues/239#issue-223851818
Is this possible?
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Is it possible to render a partial by passing a local variable for ...
In Rails 5.2.2 I am trying to render a partial using a local variable as the collection, but when running a test to...
Read more >ActionView::PartialRenderer - Rails API
You can specify a partial to be rendered between elements via the :spacer_template option. The following example will render advertiser/_ad_divider.html.erb ...
Read more >Partial views in ASP.NET Core | Microsoft Learn
Discover how to use partial views to break up large markup files and reduce the duplication of common markup across web pages in...
Read more >Partials - Frontend - Winter CMS Documentation
Introduction; Rendering partials; Passing variables to partials ... The partial configuration section can also contain component definitions ...
Read more >Let's Use Rails Partials To Render Art from Magic: the Gathering!
Using render partial : within views and other partials; Passing variables to partials with locals: Rendering partials repeatedly by iterating ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @iamkeir
This is definitely possible:
.hbs
file:Let me know if this helps.
@flepp, @LeBenLeBen Another way to do it is to set your childTemplate like
\\@card--zoom
and render it like