8 – How to check the machine name of the product type?

I have the TWIG code below that works. It checks that “Produit” is in the name of the product type.

My problem :

I want it to check the machine name of the product type (not the title of the machine name), in my case product

How do you do that ?

  {% if 'Produit' in message.field_product_reference.entity.field_pop_up_product_reference.entity.type.entity.label %}
    <a href="{{ path('entity.commerce_product.canonical', {'commerce_product': message.field_product_reference.entity.field_pop_up_product_reference.entity.id}) }}" title="{{ message.field_product_reference.entity.field_pop_up_product_reference.entity.title.value }}" class="stretched-link"></a>
  {% else %}
    <a href="{{ path('entity.commerce_product.canonical', {'commerce_product': message.field_product_reference.entity.id}) }}" title="{{ message.field_product_reference.entity.title.value }}" class="stretched-link"></a>
  {% endif %}

c# – The type or namespace name ‘Xna’ does not exist in the namespace ‘Microsoft’

I have imported a monogame project based on the Xna framework into visual studio.
But it does work for me.
I have monogame in my visual studio 2019 and xna framework, they are both working for my other monogame project but this one.
The error is this:

using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

Really appreciate it if you can answer for me!!
 

Sheets: query to count each type of result for every student

I have a table like this.

Test  | Student  | Result
--------------------------
TestA | Ray      | pass
TestA | Edwards  | fail
TestA | Phillips | pass
TestA | Holland  | pass
TestB | Chandler | fail
TestB | Burke    | fail

I want to convert it to a table like this.

Test  | Pass | Fail
-------------------
TestA | 75%  |  25%
TestB |  0%  | 100%

My goal is to make a chart that shows, for each test, the ratio of pass vs fail. I want to use a Stacked Column Chart.

So far I came up with this.

=QUERY(A:C, "select A, COUNT(B) where A is not null group by A", 1)

However, COUNT(B) counts the total of Result for each test. I want to know how many passed and how many failed.

This is almost what I want. Except TestA and TestB don’t have the same number of entries, so I want to normalize pass/fail values as a percentage.

=QUERY(A:C, "select A, COUNT(A) where A is not null group by A pivot C", 1)

categories – What type of page should i use? static page or category page? and what’s the difference?

I’m a new WordPress user and i’m very confused about my how the structure of my website should be.

I’m creating a language learning website and i started with the static pages (Home, about, etc.)

Then i wanted to create the pages related to the specific languages (Englsh, Spanish for example) and for that, i created more static pages which would have a organized list of the lessons that of course have an specific order, lesson 1, 2, 3, and so on.
the URLS would be something like: website.com/french

I wanted to make sure i was doing things right so i searched my website on Google and i saw pages called ‘French lessons archives’ with these URL: website.com/category/french that seem to be the category pages.

My questios are:
– What should i do? should i use the static pages i created? or the category page?
– Should i delete or nonindex the category page?

As a reminder, my content has an specific order, they are lessons so i don’t want the order to be updated everytime i create a lesson.

  • I read something online saying category pages are important for SEO but i don’t know what to do and i have not found an asnwer in this forums yet, i hope you can help me with this.

magento2.4.2 – Exception #0 : Notice: Trying to access array offset on value of type null in ../Calendar.php PHP 7.4

I did a new installation of Magento 2.4.2 (PHP 7.4.3). There were no errors during the installation.
The ShopURL is running.
The backend login also works.
After I switched the backend to German, the following error message occurs:

"Exception #0 (Exception): Notice: Trying to access array offset on value of type null in /myPath2project/shop/vendor/magento/framework/View/Element/Html/Calendar.php on line 114"

Where could I start to solve the problem.

Thanks in advance
Greetings heiko

What type of syntax notation is this?

SQL Server documentation uses this notation, which is very easy to understand and consume. Is this a BNF Syntax Diagram? Or is this a different type of notation?

Text

Source: SQL server documentation page with the original diagram

best practice – Expand All / Collapse All / Expand All of Type / Collapse All of Type

I have a specific “expand/collapse” problem that I’m pretty sure I have the best solution to, but my collaborator is calling “clunky.”

The particular view I’m designing is similar to the interface of Google Docs, but with a different subject matter. It takes sections from uploaded documents (such as pdfs) and displays them as a list of expandable sections – so you’ll have a bar with section number, section title and an expand/collapse arrow. Users of this application can open these sections and suggest rules to apply to the content within a section. Above all the sections, we want to have buttons for expand all / collapse all, which is simple enough, however we also want “expand sections with suggestions only” and “collapse sections with suggestions only.”

My suggestion is to have the two buttons for “expand all” and “collapse all,” with a checkbox next to it saying “only sections with suggestions” or something similar. So it would be:

( expand all ) ( collapse all ) (X) only sections with suggestions

Now, while I believe the wording after the checkbox needs a little work, it seems like a more elegant solution to having 4 different expand/collapse buttons.

My overall questions are:

  1. Do people agree with me that this is an elegant solution? (I’m sort of questioning myself now)
  2. If so, are there any suggestions for how to sell the idea as the best solution besides each of us just saying the other person’s idea is more clunky.

Thanks in advance!

Cannot create a Db Set for ‘Application Role’ because this type is not included in the model for the context. What is the problems, please helps me

When I sign-in to page. prompt error message "Cannot create a dB Set for ‘Application Role’ because this type is not included in the model for the context.". What is the problems, please helps.

8 – Pathauto pattern for a content type depending on a reference field?

This question is already asked here, but the answer selected does not work for Drupal8.

Description: There is a content-type, which has field, referencing taxonomy term. The term is in “Content class” dictionary. This term is used in views to filter the right content for the view. When a link in the view is clicked, it opens the node. This is OK.
So, it is needed pathauto to generate /Content class term/Content_title_name when this node is opened.

What did not work: (node:field_content_class:value)/(node:title). This is not accepted, produces error: Path pattern is using the following invalid tokens: (node:field_

The accepted (by Drupal) pattern: (node:field_content_class)/(node:title) generates alias, containing only the (node:title) part. The first component is empty.

This is made to not create separate content-types for nodes with the same fields.

Ultimate Member – Show List of Posts (Post Type) by all users that current logged in user follows

I am new to the ‘Ultimate Member’ plugin and I am using the ‘UM Followers’ extension plugin.

My users can all generate posts (post type).

I would like to set up a page-template in which the current logged in user can see a list of all posts sorted by most recent, only by users that he/she follows.

I had a look at the following template that generates a list of users using their avatars. But can’t figure out how I could use this to generate the list of posts by users my logged in user follows.

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

if ( $following ) {

    foreach ( $following as $k => $arr ) {
        /**
         * @var $user_id1;
         */
        extract( $arr );

        um_fetch_user( $user_id1 ); ?>
    
        <div class="um-followers-user">
    
            <a href="<?php echo esc_url( um_user_profile_url() ); ?>" class="um-followers-user-photo" title="<?php echo esc_attr( um_user( 'display_name' ) ); ?>">
                <?php echo get_avatar( um_user('ID'), 50 ); ?>
            </a>
        
            <div class="um-followers-user-name">
                <a href="<?php echo esc_url( um_user_profile_url() ); ?>" title="<?php echo esc_attr( um_user('display_name') ); ?>">
                    <?php echo esc_html( um_user( 'display_name' ) ); ?>
                </a>
            
                <?php do_action('um_following_list_post_user_name', $user_id, $user_id1 );

                if ( um_user( 'ID' ) == get_current_user_id() ) { ?>
                    <span class="um-followers-user-span"><?php _e( 'You', 'um-followers' ); ?></span>
                <?php } elseif ( UM()->Followers_API()->api()->followed( get_current_user_id(), $user_id1 ) ) { ?>
                    <span class="um-followers-user-span"><?php _e( 'Follows you', 'um-followers' ); ?></span>
                <?php }

                do_action('um_following_list_after_user_name', $user_id, $user_id1 ); ?>
            </div>
        
            <div class="um-followers-user-btn">
                <?php if ( $user_id1 == get_current_user_id() ) {
                    echo '<a href="' . esc_url( um_edit_profile_url() ) . '" class="um-follow-edit um-button um-alt">' . __( 'Edit profile', 'um-followers' ) . '</a>';
                } else {
                    echo UM()->Followers_API()->api()->follow_button( $user_id1, get_current_user_id() );
                } ?>
            </div>
        
            <?php do_action( 'um_following_list_pre_user_bio', $user_id, $user_id1 ); ?>
        
            <div class="um-followers-user-bio">
                <?php echo um_get_snippet( um_filtered_value( 'description' ), 25 ); ?>
            </div>
        
            <?php do_action( 'um_following_list_post_user_bio', $user_id, $user_id1 ); ?>
        
        </div>
    
    <?php }

} else { ?>

    <div class="um-profile-note">
        <span><?php echo ( $user_id == get_current_user_id() ) ? __( 'You did not follow anybody yet.', 'um-followers' ) : __( 'This user did not follow anybody yet.', 'um-followers' ); ?></span>
    </div>

<?php }```

thanks to anyone who could assist :)