When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:
main {
max-width: 38rem;
padding: 2rem;
margin: auto;
}
{% set imagePath = 'public://images/default.jpg' %} | |
{% set responsiveimagestyle = { | |
'#theme': 'responsive_image', | |
'#responsive_image_style_id': 'my_responsive_image_style_id', | |
'#uri': imagePath, | |
'#alt': 'my alt text', | |
'#attributes': { class: 'img-responsive' }, | |
} %} | |
{{ responsiveimagestyle }} |
<?php | |
namespace Drupal\hc_core\Plugin\search_api\processor; | |
use Drupal\node\Entity\Node; | |
use Drupal\search_api\Datasource\DatasourceInterface; | |
use Drupal\search_api\IndexInterface; | |
use Drupal\search_api\Item\ItemInterface; | |
use Drupal\search_api\Processor\ProcessorPluginBase; | |
use Drupal\search_api\Processor\ProcessorProperty; |
[Update 2024] - This gist is almost useless compared to Drupal at your fingertips. Will create pull requests to update that if something is not already there.
// Load file object
$file = File::load($fid);
This tutorial covers common use cases for configuration splits as a strategy for configuration management in Drupal 8.
Specifically it covers: