An adapter that extends the Fractal Twig adapter and introduces sub-render elements in context data.
npm install --save-dev https://github.com/das-peter/fractal-twig-context-subrender.git
in your fractal.js
const fractal = require('@frctl/fractal').create();
const twigAdapter = require('fractal-twig-context-subrender');
const twig = twigAdapter();
in your component.config.yml
status: "ready"
context:
title: "Filter results"
action: "/filter-page/"
headingLevel: "3"
pageLimit: "25"
filters:
- fieldname: "Color"
filterfrontend: "$filter-types--select"
- fieldname: "Size"
filterfrontend:
"$filter-types--select":
currentValue: "M"
values:
- value: 'S'
count: 8
- value: 'M'
count: 10
- value: 'L'
count: 1
resultCount: 19
fieldname: "Color"
: thefilterfronted
property will contain the rendered output of the@filter-types--select
component. The component will be rendered with the default / variant context.fieldname: "Size"
: thefilterfronted
property will contain the rendered output of the@filter-types--select
component. The component will be rendered with the context data provided under the key$filter-types--select
.
If you defined the key__importContext
in the context the rendering will do a deep merge of the component context with the customized properties. Otherwise it will behave as configured using theimportContext
flag.