Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 881 Bytes

File metadata and controls

22 lines (15 loc) · 881 Bytes
description page_type month_change
AI Actions functions allows you to embed AI Actions in your templates
reference
false

AI Actions Twig functions

AI Actions functions allows you to pass information about AI Actions to the Twig templates.

ibexa_ai_config()

The ibexa_ai_config function loads the configuration of an Action Type with given identifier.

    {% set ai_config = ibexa_ai_config('refine_text') %}
    {% set ai_config2 = ibexa_ai_config('refine_text', { 'some': 'optional data' }) %}

    <div class="hidden" data-ai-config-name="refine_text" data-ai-config="{{ ai_config|json_encode }}"></div>

You can use the ResolveActionConfigurationWidgetConfigEvent event to modify the configuration after it's been loaded. The optional data provided in the function call is available in the event object.