Customize drop down commerce cart css Drupal 9 Commerce 2

#block-cart .cart-block--contents {

  width: 300px;

  background: white;

  color: black;

  font-size: 14px;

  border: #033558 3px solid;

}

#block-cart .cart-block--contents__inner {

  padding: 10px;

}

Spaces the columns

#block-cart .cart--cart-block .cart-block--contents td{

padding-left: 1em;

 

}

Separates the items in the cart

Custom Twig Links- Menu links shown on if and conditions

<div class="logout-myaccount-page">
      {% set url = url('<current>') %}
    
        {% if (logged_in) and 'participant' in url|render|render %}
          <ul>
            <li>{{ link('My Account', 'route:user.well-known.change_password') }}</li>
            <li>{{ link('Logout', 'route:user.logout') }}</li>
          </ul>
          {% elseif (logged_in) and 'edit' in url|render|render %}
          <ul>

custom route URL to custom node by Node ID #

 /*Upgrade Button for view*/
      if($statuses['floater']) {
        $options = ['absolute' => TRUE];
        $url2 = \Drupal\Core\Url::fromRoute('entity.node.canonical', ['node' => 67], $options);
        $url2->setOptions(['attributes' => ['class' => ['btn']]]);
        $upgradebut = Link::fromTextAndUrl(t('Upgrade'), $url2);
      }

 

 

Creates a button

Drupal 9 Twig User pages cheat sheet.

Case use:

{% if logged_in %}
{{ link('Logout', 'route:user.logout') }}
  {% else %}
  {{ link('Login', 'route:user.login') }}
  {% endif %}

 

 

 

user.register:

path: '/user/register'

defaults:

_entity_form: 'user.register'

_title: 'Create new account'

requirements:

_access_user_register: 'TRUE'

 

user.logout:

path: '/user/logout'

defaults:

Login and Logout Links on the condition of user logged in. - Twig Drupal 9

 

The code in my template file. (Page.html.twig)

<div class="login-logout">
{% if logged_in %}
{{ link('Logout', 'route:user.logout') }}
  {% else %}
 {{ link('Login', 'route:user.login') }}
  {% endif %}
  </div>

 

My css to make my link display where and how I want it

Black Screen of death- Dell G-force- Windows 11

Came back from a weekend visiting my son and my Dell would load the Dell logo then go to a black screen.

This is what worked for me.

Unplug all the cords, USBs, Display Ports, HMDIs and the desktop immediately came on. One of my monitors had been unplugged from the power source, so I guess that was causing the BSOD for me.

Of course it could be something more serious than mine situation, but hopefully it is not and this fix is your solution too.

 

 

The "gdpr_task" entity type does not exist. Drupal 9

On my local the error comes up when enabling the Layout builder module.

I believe it was because the previous developer had GDPR installed and enable then decided not to use the module and disabled it.

 

So I re-enabled the module and the error went away.

 

To get rid of GDPR_tasks

1.lando drush en gdpr_tasks -y

2. drush config-delete field.field.gdpr_task.gdpr_remove.removal_log
3. drush config-delete field.storage.gdpr_task.removal_log
4. drush pmu gdpr_tasks

5. lando drush pmu gdpr -y

Email one time Password Reset link to a user from Admin side- Drupal 9

This changed a little bit from Drupal 7 so here's the code.

The module adds a button to the bottom of the User "Edit" page. :) Click the button and it shoots an email with a reset link to that user. :) 

 

YourModuleName.info.yml File

name: 'YourModuleName'
type: module
description: 'Reset Password link for administrators'
core_version_requirement: ^8 || ^9
package: 'Custom'

 

YourModuleName.moduleFile

<?php

 

/**

Lando, Composer, Drush, Drupal Core Update

Just started using PlatformSh so these are just instructions for me. In case I forget how to do it.

 

1. Lando Start

2.  lando composer install
(Make sure it is there and updated)

3. lando composer update "drupal/core-*" --with-all-dependencies
(Gets the newest drupal core with composer)

4. lando drush updb -y
(Updates the database)

5. lando rebuild
(Makes it clean. :) )

 

If you run into a Composer memory allot issue, do this:

Run these commands

Pages

Subscribe to Melinda Cozza - Power Platform and CMS Developer RSS