Drupal Twig

$form[‘field_name’][$value[‘id’]] = [
‘#type’ => ‘table’, ‘#tag’ => ‘tr’,
‘#attributes’ => [‘style’ => ‘display:none’]
];

$form[‘field_name’][$value[‘id’]] = [
‘#id’ => ‘field_name’, ‘#type’ => ‘hidden’, ‘#value’ => 1,
‘#prefix’ => ‘1’, // 1<input type=”hidden”> みたいな表示になる
];

$form[‘input’][‘button_on_off’] = [
‘#type’ => ‘hidden’, ‘#value’ => $button_flag,
];

{{dump(_context|keys)}}

{{ content.field_col_name.0[‘#text’]|striptags|replace({‘&nbsp;’:”, ‘\r\n’:”, ‘\n’:”, ‘\r’:”})|slice(0,50)|raw }}
{% if “now”|date(‘Y-m-d H:i:s’) > content.field_col_date.0[‘#markup’]|date(‘Y^m^d H:i:s’) %}
{% set get_param = get_paramter(‘nid.content.param’) %}
{{ content.view_name_view_page_section }}
{% set item_array = item_array(content.field_col_name.0[‘#text’]) %}
{% if content.field_col_item.getValue()|first.value > 0 %}
{% for item in items if not break %}{{ item.content }}{% if loop.index == 4 %}{% set break = true %}{%- endif -%}

{% set rows_count = ((rows|length) / 8) | round(0, ‘cell’) %}

{% set get_color = drupal_field(‘field_col_coler’, ‘node’, get_param) %}
{{ drupal_field(‘field_col_link’, ‘node’, 3) }}
{{ drupal_view(‘view_name’, ‘view_page_section’) }}

{{ label.0[‘#context’].value|length > 10 ? label.0[‘#context’].value|slice(0, 10) ~ ‘…’ : label.0[‘#context’].value }}

{% if paragraph.field_col_link.0.url.toString() is empty %}

{{ row.cells.0.context[‘color_flag’] }}

{% if path(‘<current>’) == ‘/cart’ %}
{% url(‘<current>’)[‘#markup’]|split(‘/’)|last == get_paramter(‘nid.content.top’) %}

drupal.libraries.yml

item:
js:
js/link-and-url.js: {preprocess: false}

{{ attach_library(‘drupal/item’) }}

返信を残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です