The TextString-Component is part of the tobit-chayns_components package. It can be installed via npm:
npm install --save-dev tobit-chayns_components
At first the component needs to be imported:
import TextString from 'tobit-chayns_components/react-chayns-textstring';
The component can be used in JSX like in the following example:
<TextString textString="txt_mein_textstring"/>
Property | Description | Type | Default Value |
---|---|---|---|
textString | Name of the textstring (i.e. txt_rating_intro) | String | |
renderHtml | Render the textstring as HTML | Bool | false |
replace | eplace placeholders with the given value | Object | |
render | Auto-render textstrings if they were set as an HTML attribute | Bool | true |
<TextStrings textString="txt_rating"
replace={{
'##location_id##': window.chayns.env.site.locationId,
'##site_id##': window.chayns.env.site.id
}} />
To use HTML in an textstring it has to be activated in the component.
<TextStrings textString="txt_rating"
renderHtml={true} />