For more information about this repository, visit the project page at https://www.drupal.org/project/twig_tweak
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
3.4 KiB

{% set image_attributes = {style: 'width: 30px; height 30px;'} %}
8 years ago
<style>
.tt-test > div {
margin: 15px;
padding: 10px;
outline: solid 2px dodgerblue;
}
.tt-test > div::before {
content: attr(class);
font-weight: bold;
display: block;
font-style: italic;
border-bottom: solid 1px dodgerblue;
margin-bottom: 10px;
padding-bottom: 5px;
color: dodgerblue;
}
</style>
<div class="tt-test">
8 years ago
<div class="tt-view-default">{{ drupal_view('twig_tweak_test') }}</div>
<div class="tt-view-page_1">{{ drupal_view('twig_tweak_test', 'page_1') }}</div>
<div class="tt-view-page_1-with-argument">{{ drupal_view('twig_tweak_test', 'page_1', 1) }}</div>
<div class="tt-view-result">{{ drupal_view_result('twig_tweak_test', 'page_1')|length }}</div>
<div class="tt-block">{{ drupal_block('system_branding_block', {use_site_name: false}, false) }}</div>
<div class="tt-block-with-wrapper">{{ drupal_block('system_branding_block', {label: 'Branding'}) }}</div>
<div class="tt-region">{{ drupal_region('sidebar_first') }}</div>
8 years ago
<div class="tt-entity-default">{{ drupal_entity('node', 1) }}</div>
<div class="tt-entity-teaser">{{ drupal_entity('node', 1, 'teaser') }}</div>
<div class="tt-entity-from-url">{{ drupal_entity('node') }}</div>
<div class="tt-field">{{ drupal_field('body', 'node', 1) }}</div>
<div class="tt-menu-default">{{ drupal_menu('twig-tweak-test') }}</div>
<div class="tt-menu-level">{{ drupal_menu('twig-tweak-test', 2) }}</div>
<div class="tt-menu-depth">{{ drupal_menu('twig-tweak-test', 1, 1) }}</div>
<div class="tt-form">{{ drupal_form('Drupal\\system\\Form\\CronForm') }}</div>
<div class="tt-image-by-fid">{{ drupal_image(1, attributes=image_attributes) }}</div>
<div class="tt-image-by-uri">{{ drupal_image('public://druplicon.png', attributes=image_attributes) }}</div>
<div class="tt-image-by-uuid">{{ drupal_image('b2c22b6f-7bf8-4da4-9de5-316e93487518', attributes=image_attributes) }}</div>
<div class="tt-image-with-style">{{ drupal_image(1, 'thumbnail', image_attributes) }}</div>
<div class="tt-image-with-responsive-style">{{ drupal_image(1, 'example', image_attributes, true) }}</div>
8 years ago
<div class="tt-token">{{ drupal_token('site:name') }}</div>
<div class="tt-token-data">{{ drupal_token('node:title', {'node': node}) }}</div>
8 years ago
<div class="tt-config">{{ drupal_config('user.settings', 'anonymous') }}</div>
<div class="tt-title">{{ drupal_title() }}</div>
<div class="tt-url">{{ drupal_url('node/1', {absolute: true}) }}</div>
<div class="tt-link">{{ drupal_link('Edit', 'node/1/edit', {absolute: true}) }}</div>
<div class="tt-messages">{{ drupal_messages() }}</div>
<div class="tt-breadcrumb">{{ drupal_breadcrumb() }}</div>
<div class="tt-link-access">{{ drupal_link('Edit', 'node/1/edit', {absolute: true}, true) }}</div>
8 years ago
<div class="tt-token-replace">{{ 'Site name: [site:name]' | token_replace }}</div>
<div class="tt-preg-replace">{{ 'FOO' | preg_replace('/(foo)/i', '$1-bar') }}</div>
8 years ago
<div class="tt-image-style">{{ 'public://images/ocean.jpg' | image_style('thumbnail') }}</div>
<div class="tt-transliterate">{{ 'Привет!' | transliterate('ru') }}</div>
<div class="tt-check-markup">{{ '<b>bold</b> <strong>strong</strong>' | check_markup('twig_tweak_test') }}</div>
<div class="tt-node-view">{{ node|view }}</div>
<div class="tt-field-list-view">{{ node.title|view }}</div>
<div class="tt-field-item-view">{{ node.title[0]|view }}</div>
8 years ago
</div>