Hi,

How I could access deeper options for Smart Trim module. In this case there is an option to Strip HTML. However, I don't see a way to set such an array element.

Current token which fails:

[paragraph:field_paragraph_body-formatted:0:smart_trim:trim_length-26:trim_options-text]

Smart trim logic to check if Strip HTML option has been checked:

$setting_trim_options = $this->getSetting('trim_options');
if (!empty($setting_trim_options['text'])) {

Comments

DavisA created an issue. See original summary.

  • deciphered authored 4783cbea on 2.0.x
    feat(#3143597): support dot-notation for nested formatter settings
deciphered’s picture

Version: 8.x-1.x-dev » 2.0.x-dev
Status: Active » Fixed

You can now use dot notation to set nested formatter settings:

[paragraph:field_paragraph_body-formatted:0:smart_trim:trim_length-26:trim_options.text-1]

This builds trim_options => ['text' => '1'], which enables Smart Trim's "Strip HTML" option. Any array-valued formatter setting works the same way.

Committed to 2.0.x.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.