{% if content.field_image['#object'] is not empty %}
{% set image_src = file_url(content.field_image['#object'].field_image.entity.fileuri) %}
{% else %}
{% set image_src = 'https://via.placeholder.com/600x400' %}
{% endif %}
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
#!/bin/sh | |
PROJECT=$(php -r "echo dirname(dirname(dirname(realpath('$0'))));") | |
STAGED_FILES_CMD=$(git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\.php) | |
UNSTAGED_FILES_CMD=$(git diff --name-only --diff-filter=ACMR | grep \\.php) | |
# Determine if a file list is passed | |
if [ "$#" -eq 1 ] | |
then | |
oIFS=$IFS |
With the release of Composer version 2, ServerPilot now provides this version to all servers by default. However, some applications may not be fully compatible with version 2, and so you may need to use version 1 until they address those incompatibilities.
If for any reason you need to downgrade Composer to the latest version 1 release, you can do so by running the following command as root:
sudo composer self-update --1
To prevent ServerPilot from automatically updating its package to version 2 in the future, you can tell the advanced package tool (apt) software to hold our package by running the following command as root:
sudo apt-mark hold sp-composer
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
const breakpoints = { | |
xs: 480, | |
sm: 768, | |
md: 1024, | |
lg: 1280, | |
xl: 1440 | |
} | |
function minWidth(screensize){ | |
return window.matchMedia(`(min-width: ${screensize}px)`); |
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
name: drupal9 | |
recipe: drupal9 | |
config: | |
webroot: docroot | |
services: | |
phpmyadmin: | |
type: phpmyadmin | |
hosts: | |
- database | |
proxy: |
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
<?php | |
namespace Drupal\sample_module\Plugin\Block; | |
use Drupal\Core\Block\BlockBase; | |
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
use Drupal\Core\Form\FormStateInterface; | |
use Drupal\Core\Config\ConfigFactoryInterface; | |
use Drupal\sample_module\Form\SampleAdsSettingsForm; |
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
<?php | |
/** | |
* Get Time ago format. | |
*/ | |
function timeDiff($datetime) { | |
$time = time() - strtotime($datetime); | |
$units = [ | |
31536000 => 'year', |
NewerOlder