Drupal Blog

Shopify social media code snippet

      {%- assign social_accounts = 'facebook, twitter, pinterest, instagram, snapchat, tumblr, youtube, vimeo, linkedin,' | split: ', ' -%}
      <div class="social-sharing d-flex align-items-center">
            {% include 'social-links' %}
        {% for social in social_accounts %}
          {%- assign social_handle = social | handleize -%}
          {% capture social_link %}social_{{ social_handle }}_link{% endcapture %}

Example of using this with a date field from a node in order to get it to format the date in the correct timezone

use Drupal\Core\Datetime\DrupalDateTime;

$date = new DrupalDateTime($mynode->field_my_date_field->value, 'UTC');
$formatted_date = \Drupal::service('date.formatter')->format($date->getTimestamp(), 'custom', 'F j, Y h:ia');

Drupal Commerce

Drupal Commerce provides a truly flexible, solid foundation for building even very complex business applications. Some of the reasons it stands out as an excellent and secure solution are the following:


Create a new administrator account in drupal with drush

In otder to create a new user in your website using drush, you'll need to run the following commands:

$ drush user-create YourUsername --mail="your@mail.com" --password="YourPassword"

This will create a new user in the website.

In order to assign the role administrator to the user run:

$ drush user-add-role "administrator" YourUsername


Who uses Drupal?

Why Drupal?

Drupal is the leading open source content management system for developing sophisticated, flexible and robust websites, social media networks and applications.

Recent Comments

Forward by Dries Buytaert, Founder and Project Lead, Drupal; CTO Acquia.

Order now from:

Managing Expectations Podcast with DrupalEasy

Author Interview http://tinyurl.com/8a8nxno

We provide the most Shiny Drupal Bits & Pixels

Since Drupal 4.x