Skip to content

Instantly share code, notes, and snippets.

View markconroy's full-sized avatar

Mark Conroy markconroy

View GitHub Profile
function MYMODULE_template_preprocess_default_variables_alter(&$variables) {
$current_path = \Drupal::service('path.current')->getPath();
$variables['current_path'] = $current_path;
}
/**
* Implements hook_preprocess_HOOK() for paragraph--para-image-text.html.twig.
*/
function THEME_preprocess_paragraph__para_image_with_text(&$variables) {
$paragraph = $variables['paragraph'];
// Get the value of the image style and add it as a class on the image field.
$style_image = $paragraph->get('field_para_image_with_text_float')->value;
$variables['attributes']['class'][] = $style_image;
function THEMENAME_theme_suggestions_block_alter(array &$suggestions, array $variables) {
if (isset($variables['elements']['content']['#block_content'])) {
$suggestions[] = 'block__' . $variables['elements']['content']['#block_content']->bundle();
}
}
{% set block_bundle = content.body['#bundle'] %}
{%
set classes = [
block_bundle ? ~ 'block--' ~ block_bundle|clean_class,
// …
]
%}
diff --git a/src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php b/src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php
index 0859058..7dbd166 100644
--- a/src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php
+++ b/src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php
@@ -574,12 +574,14 @@ class InlineEntityFormComplex extends InlineEntityFormBase implements ContainerF
}
}
// Sort values by weight.
- uasort($values, '\Drupal\Component\Utility\SortArray::sortByWeightElement');
- // Let the widget massage the submitted values.
diff --git a/core/misc/ajax.js b/core/misc/ajax.js
index fefe9f3..c1c81f9 100644
--- a/core/misc/ajax.js
+++ b/core/misc/ajax.js
@@ -1061,13 +1061,19 @@
// Immediately hide the new content if we're using any effects.
if (effect.showEffect !== 'show') {
- $new_content.hide();
+ // I am commenting out the following line, as it makes any paragraph
diff --git a/core/misc/ajax.js b/core/misc/ajax.js
index fefe9f3..c1c81f9 100644
--- a/core/misc/ajax.js
+++ b/core/misc/ajax.js
@@ -1061,13 +1061,19 @@
// Immediately hide the new content if we're using any effects.
if (effect.showEffect !== 'show') {
- $new_content.hide();
+ // I am commenting out the following line, as it makes any paragraph
{% set image_file_path = content.field_teaser_image[0]['#media'].field_media_image.entity.uri.value %}
{% set image_file_alt = content.field_teaser_image[0]['#media'].field_media_image.0.alt %}
<div class="teaser__image">
{% if node.field_teaser_image_style.value == 'portrait' %}
<a href="{{ url }}">
<img src="{{ image_file_path | image_style('portrait_teaser') }}" alt="{{ image_file_alt }}">
</a>
{% endif %}
{%
set classes = [
"card",
card_image ? 'card--has-image',
card_style ? 'card--' ~ card_style,
card_size ? 'card--' ~ card_size,
]
%}
{% if card_link_url %}