Skip to content

How to use Carbon Fields Blocks with Sage blade template? #1128

Answered by sariyanta
sariyanta asked this question in Q&A
Discussion options

You must be logged in to vote

For those who might want to do the same, I figured out how to use the blade template in sage theme to render the carbon-fields block.

The block contents need to be passed as the second argument in de view method in an array like below.

->set_render_callback( function ( $fields, $attributes, $inner_blocks ) {
        $fields['block'] = $attributes;
		echo \Roots\view('components.test', ['fields' => $fields])->render();
	} );

Replies: 1 comment

Comment options

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