Adding braces into query with ternary operator

hi, is there a way to add special characters like braces into a query string with ternary operator?
i’m looping through a collection and would like to show the “firma”-field in braces only if it exists.

query: collection('clients')
text: "{{page.title}} {{ page.firma.isNotEmpty ? '(' : '' }}{{ page.firma.isNotEmpty ? page.firma : ''}}{{ page.firma.isNotEmpty ? ')' : '' }}"

this is my solution which works but i think there must be a shorter way.

i tried js-style and a nested version and a few other things but they didn’t work:

text: "{{page.title}} {{ page.firma.isNotEmpty ? '(' + page.firma + ')' : '' }}
text: "{{page.title}} {{ page.firma.isNotEmpty ? ({{ page.firma' }}) : '' }}

thanks!

Don’t think it will work like that. If you need the parentheses, I’d create a custom field method that wraps the value in parens.

text: "{{ page.title }} {{ page.firma.isNotEmpty ? page.firma.embrace : ''}}"
'fieldMethods' => [
	'embrace' => function ($field) {
		$field->value = '(' . $field->value . ')';
		return $field;
	},
],