Drupal is up and running but how do I ...?

Print current user in menu.html.twig file

Since menu templates do not have direct access to the user object, we need to pass it manually in my_theme.theme

function my_theme_preprocess_menu(&$variables) {
$current_user = \Drupal::currentUser();
$variables['current_user_name'] = $current_user->getDisplayName();
}

Now, you can use it inside menu.html.twig

<p>Hello, {{ current_user_name }}!</p>
 

Drupal Cache clearing Cron not clearing cache

In our Drupal 9 website, whenever we are running cron we are facing a error in our logs. 

Though it shows CRON run is completed, the cache_page table and key_value_expire table size is not reducing. 

Can anyone help or has anyone faced a similar  situation and below error:

Error:

Content views with taxonomy reference

Hello,

i try to build a custom block in views, to display all terms of referenced content.

My configuration is as follows:

Content types: Person, adventure, gear.

An adventure references to a person and a gear references to an adventure. My taxonomy terms are:

  • - Bike
  • -- Smartphone
  • --- Mounting
  • -- Bags
  • -- Tools
  • - Clothes
  • -- T-shirt
  • -- Jeans

... and so on

Show video frame location on map (e.g., Leaflet Map) using a moving marker

 TL;DR:

I have the following settings.

1). Custom content type.

2). Three (3) custom fields: a geofield, a file field (for GPX data upload) and a media field (for mp4 video). 

3). For the geofield setting, I chose "geocode from existing field" and selected the file field (GPX) to be used to geocode the map. 

4). Currently, I'm able to display a track (route) of the video on the map through the GPX data uploaded as a separate file.

See image illustration in the link below. The image shows the fields in the node display.

Best Practice for syncing configurations among multiple developers

Hello - we have a team of developers all working on developing a site. We each have our own local/sandbox database and Drupal site.  The problem is that while we're doing our own assigned development tasks, we each make configuration changes to our local/sandbox Drupal site. What is the best way to merge our site configurations (YAML files) to arrive at a set of config YAML files that would represent the combined configurations? Right now our workflow is:

Export the base Drupal configuration (set of YAML files) and push that to Git.

Indicate video frame location on map (e.g., leaflet map, etc.) using a moving marker

​Indicate video frame location on map (e.g., leaflet map, etc.) using a moving marker

 TL;DR:

I have the following settings.

1). Custom content type.

2). Three (3) custom fields: a geofield, a file field (for GPX data upload) and a media field (for mp4 video). 

3). For the geofield setting, I chose "geocode from existing field" and selected the file field (GPX) to be used to geocode the map. 

Pages

Subscribe with RSS Subscribe to RSS - Post installation