Eric_F
June 13, 2023, 10:29am
1
New to Bricks and trying to do a simple setup using ACF.
I have the following custom field.
Item (text field)
Colors (checkbox with options for red, green, and blue)
I made a test page and got the loop working and everything but the dynamic data for “Colors” is comma separated, so when I add it in it shows as
red, green, blue.
Is it possible to have to displayed in a list like
red
green
blue
where each item is on its own line?
dovely
June 13, 2023, 10:33am
2
Can you drop the link to the test page? I’m thinking one line of CSS should be able to achieve the list effect. But without page URL to inspect the output element, one can’t be certain.
Eric_F
June 13, 2023, 10:41am
3
Super simple setup, just have 2 columns with headings linked to the fields.
Hey Eric,
please try to use the following hook:
add_filter( 'bricks/dynamic_data/format_value', function( $value, $tag ) {
if ( $tag !== 'acf_colors' ) {
return $value;
}
return str_replace( ', ', '<br>', $value );
}, 10, 2 );
Replace acf_colors
with acf_NAME_OF_YOUR_CHECKBOX_FIELD
. You might have to adjust the code depending on your exact setup.
Best,
André