This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Implementation of hook_entity_view | |
*/ | |
function helpermodule_entity_view($entity, $type, $view_mode, $langcode) { | |
// we're viewing an entity | |
// check if it's a profile2 type | |
// - if there's more than one profile2, check for that too! | |
// - and the view mode is 'page' (not 'full', for profile2 it seems) | |
if ($type == 'profile2' && $entity->type == 'member' && $view_mode == 'page') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If your site can be accessed both with and without the 'www.' prefix, you | |
# can use one of the following settings to redirect users to your preferred | |
# URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option: | |
# | |
# To redirect all users to access the site WITH the 'www.' prefix, | |
# (http://example.com/... will be redirected to http://www.example.com/...) | |
# uncomment the following: | |
RewriteCond %{HTTP_HOST} . | |
RewriteCond %{HTTP_HOST} !^www\. [NC] | |
RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// paragraph text field actual text | |
{{ paragraph.field_title.value }} | |
// paragraph link field uri - internal:/ style (useless?) | |
{{ paragraph.field_link.0.uri }} | |
// content has this value - is processed, not validated (good in some cases) | |
{{ content.field_link[0]['#url'] }} | |
// paragraph image field uri |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_theme_suggestions_HOOK_alter(). | |
* Courtesy @nicrodgers | |
*/ | |
function MYTHEME_theme_suggestions_block_alter(array &$suggestions, array $variables) { | |
if (isset($variables['elements']['content']['#block_content'])) { | |
$block_content = $variables['elements']['content']['#block_content']; | |
$suggestions[] = 'block__' . $block_content->bundle(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "paragraph.html.twig" %} | |
{% block paragraph %} | |
<div{{ attributes.addClass('panel-group') }} id="accordion-{{ paragraph.id() }}" role="tablist"> | |
{% for field in content %} | |
{% set field_instance_items = [] %} | |
{% for key, field_instance in field if key|first != '#' %} | |
{% set field_instance_items = field_instance_items|merge([field_instance]) %} | |
{% endfor %} | |
{% if field_instance_items is not empty %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Provides suggestions for different parts, so that blocks are properly loaded | |
* | |
* @see hook_theme_suggestions_alter() | |
* | |
* @param array $suggestions | |
* @param array $variables | |
* @param string $hook | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.view-VIEWNAME td .dropbutton-multiple { | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
padding: 0 !important; | |
margin: 0 !important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div{{ attributes.addClass('container') }}> | |
{% for item in items %} | |
{# NB! notation: loop.index is 1 start, loop.index0 is zero start #} | |
<div class="row {{ loop.index0 is odd ? 'zebra-odd' : 'zebra-even' }}"> | |
<div{{ item.attributes }}>{{ item.content }}</div> | |
</div> | |
{% endfor %} | |
</div> |
OlderNewer