I hereby claim:
- I am renebakx on github.
- I am renebakx (https://keybase.io/renebakx) on keybase.
- I have a public key ASCmtcme0jjfGgvE66XnuKP7-t0RedQHrzV6D4WTTDzuowo
To claim this, I am signing this object:
| Sometimes you need to implement HTML from a style guide, but commenting out the whole block with {# #} makes it unreadable. | |
| This little 'trick' let's your editor do proper syntax highlighting without showing the HTML in your output | |
| {% if false == true %} | |
| <div class="form-column"> | |
| <label for="upload">Your Resumé</label> | |
| <div class="file-upload-field"> | |
| <div class="name-display"> | |
| <svg class="icon icon-check"><use xlink:href="#icon-check"></use></svg> |
| <?php | |
| namespace App\Traits; | |
| use Illuminate\Database\Eloquent\Model; | |
| use Illuminate\Database\Eloquent\ModelNotFoundException; | |
| use Ramsey\Uuid\Uuid; | |
| trait Uuids { |
| {# | |
| So you have field that can hold 5 images, but you want them to render at random in the frontend? | |
| No problem, get https://www.drupal.org/project/tlh version 8.x-1.6 or higher and use the shuffle filter! | |
| #} | |
| {% for item in items|shuffle %} | |
| {{- item.content -}} | |
| {% endfor %} | |
| {# Be aware of render cache when doing this trick #} |
| <?php | |
| function geocoder_entity_presave(Drupal\Core\Entity\EntityInterface $entity) { | |
| if ($entity->getEntityTypeId() == 'node' && $entity->bundle() == 'distributor'){ | |
| $street = $entity->get('field_street')->getString(); | |
| $city = $entity->get('field_city')->getString(); | |
| $country = $entity->get('field_country')->getString(); | |
| $adress = sprintf('%s, %s, %s',$street,$city,$country); | |
| $geocode = new Geocode(); |
| # These two functions asume your are in de public folder of a D8 project | |
| # Run drupal from project when possible | |
| function dpl() { | |
| if [ -f "../vendor/bin/drupal" ] | |
| then | |
| ../vendor/bin/drupal "$@"; | |
| else | |
| drupal "$@"; | |
| fi |
I hereby claim:
To claim this, I am signing this object:
| tndt_config.siteconfig: | |
| type: config_object | |
| mapping: | |
| right_text: | |
| type: string | |
| label: 'Text block right' | |
| translatable: true | |
| right_title: | |
| type: string | |
| label: 'Title block right' |
| # Doesn't show fields to translate | |
| tndt_config.siteconfig: | |
| type: config_object | |
| label: 'Sitewide Configuration' | |
| mapping: | |
| right_text: | |
| type: string | |
| label: 'Text block right' | |
| translatable: true |
| /** | |
| * Since the patches/fixes for issues | |
| * 2923634 - [PP-1] Use hook_theme_suggestions in views | |
| * 2118743 - [PP-3] Twig debug output does not display all suggestions when an array of theme hooks is passed to #theme | |
| * | |
| * Won't most likely not be in core before D9 lands and frontend developers still rely on those hints being available | |
| * in the twig debug. | |
| * | |
| * You can add this snippet to add them back. | |
| * But be carefull, this version doesn't merge or keep the $suggestions other modules or theme might have added! |
| <?php | |
| function tagmanager_page_top(array &$page_top) { | |
| if (FALSE === \Drupal::service('router.admin_context')->isAdminRoute()) { | |
| $page_top['above'] = [ | |
| '#noscript' => true, | |
| '#type' => 'html_tag', | |
| '#tag' => 'iframe', | |
| '#attributes' => [ | |
| 'src' => sprintf('https://www.googletagmanager.com/ns.html?id=%s',$settings->get('gtm_code')), | |
| 'height' => 0, |