product attribute – how to change image when we select dropdown value?

I have created a custom dropdown attribute name “manufactures_guarantee_length”,
and its value like 1_year_guaranty,2_year_guaranty,3_year_guaranty, more,
in the product details page, I call that attribute,
now when we change the attribute value in any product that kind of image should change at the front-end product detail page,

for that, I have created a layout file catalog_product_view.xml and guaranty.phtml file,
in phtml file, I code like

<?php $product = $block->getProduct(); ?>
<?php echo $product->getData('manufactures_guarantee_length'); ?>

so I get the value of dropdown, so now how to change like Image as per dropdown?
please suggest me on this.
Thanks in advance.

8 – Form API placeholder attribute rendered as “- Select -“

In a custom Drupal 8 module, I have a couple of Form API fields of '#type' => 'select':

<?
    $form('form-right')('field_role') = (
      '#type' => 'select',
      '#title' => $this->t('Role'),
      '#title_display' => 'invisible',
      '#required' => TRUE,
      '#options' => (
        'foo' => $this->t('Role Foo'),
        'bar' => $this->t('Role Bar'),
        'baz' => $this->t('Role Baz'),
        'quux' => $this->t('Role Quux'),
        'plugh' => $this->t('Role Plugh'),
        'xyzzy' => $this->t('Role Xyzzy'),
      ),
      '#attributes' => (
        'placeholder' => $this->t('Role'),
      ),
    );

    $form('form-right')('field_contact_reason') = (
      '#type' => 'select',
      '#title' => $this->t('Contact Reason'),
      '#title_display' => 'invisible',
      '#required' => TRUE,
      '#options' => (
        'foo' => $this->t('Contact Reason Foo'),
        'bar' => $this->t('Contact Reason Bar'),
        'baz' => $this->t('Contact Reason Baz'),
        'other' => $this->t('Other'),
      ),
      '#attributes' => (
        'placeholder' => $this->t('Contact Reason'),
      ),
    );

Before a value is selected, the dropdown select picklists display the string '- Select -':

Form API placeholder attribute rendered as "- Select -"

The client would like them to display the value in the placeholder attribute instead.

Have I done something wrong?

is it possible to select items in page and order by drag and drop them in another page in a multi pages form

As in https://www.drupal.org/project/webform/issues/3037186

i’m asking the same request here as suggested in the issue

On Drupal8 and Webform, is there a way to have something like that :

  • user chooses X items in a list ;
  • he can order those X items by drag and drop ?

Notepad++ keyboard shortcut to select the remaining part of document before cursor

Just you can hit SHIFT+CTRL+HOME.

  • SHIFT is used to select text by moving cursor.
  • CTRL+HOME will take cursor to the beginning of the file.

Where SHIFT+CTRL+END will do the opposite thing, select after the cursor.

If you remove CTRL it will just select in the current lines.

postgresql – Inadvertently created a table named “select * from table where …”

I found out I created a table with this literal name
“select *
from rendiconti.mapping_stringhe ms
where nome_tabell”, but I don’t know how!

I know that a query like

select column1 into my_var 
from my_table

executed outside of a function will create a table named “my_var” with the value from the query, but this! I have no idea. Any suggestions?
I use DBeaver 7.2.0 as db administration tool, I don’t exclude it could be a bug of that software.

macos – hidden accounts: why change home directory location and select UniqueID less than 500?

I am reading this post from TechRepublic on how to create a hidden admin account on macOS which recommends to:

  • set User ID to be less than 500
  • change home directory, e.g. to /var/username

Do these steps really improve security and if so, how?

Or is this just security through obscurity?

After all, it seems to me that any user can ls /Users and ls /var, and at least see which users have their home directories there (though access would be denied).

Furthermore, it looks like by default the Sharing & Permissions values of a home directory are set to:

  • user: Read & Write
  • staff: Read Only
  • everyone: Read Only

For security, it would be preferable to have:

  • user: Read & Write
  • staff: Write Only (Drop Box)
  • everyone: No Access

neomutt – Saving an attachment in Mutt – how to select a directory using the list view

Browse to the directory ~/a/b/c and then use N to save as a new file in that directory.

You can then either type a file name, or if you want to save under the name that the attachment has, simply hit return: You’ll be prompted “File … is a directory, save under it?” which defaults to yes, so you can hit return again. Then mutt offers to save as ~/a/b/c/name_of_attachment

i select the usb boot option from Bios it opens up all the files from the usb, asks me for a specific file to boot

Adding usb boot optionAfter selecting usb bootstrong text

css – React change antd select background color

I am using React Ant component. I would like to change the background color of Select.

I have followed the method from How to change the style of a Ant-Design ‘Select’ component?. It didn’t work if the ‘antd/dist/antd.css’ was imported. However, it did change the background color of Select if ‘antd/dist/antd.css’ had not been imported.

How should I change the color with the import of ‘antd/dist/antd.css’? The following is the code and css for react

AntdSelect.js

import React from 'react'
import { Select } from 'antd'
import 'antd/dist/antd.css';
import  './antd.css'
const { Option } = Select;

function AntdSelect() {
    return (
        <div>
            <Select
                className="ant-select-selection"
                style={{ width: 200 }}>
                <Option value="Daily">Daily</Option>
                <Option value="Weekly">Weekly</Option>
                <Option value="Monthly">Monthly</Option>
                <Option value="Yearly">Yearly</Option>
            </Select>          
        </div>
    )
}

export default AntdSelect

antd.css

.ant-select-selection {
  background-color: green;
}

The objective is to change the background color to green:
Background green

lista – Como listar los campos de mi consulta Select distinct en PHP

Estoy ejecutando una consulta en mysql de un select distinct y en mysql me da los resultados que yo estoy esperando sin embargo, en PHP no se como listar ese resultado de mysql.
mi consulta es esta:
SELECT store,order, count(DISTINCT order) FROM pedidos GROUP BY store ORDER BY store ASC

y mi resultoado es este:

Store 001
count distinct order 123

sin embargo, en PHP no se como listar esta consulta.