Remove the Core/Any stylesheets or JavaScript from a theme in Drupal 8

 If you developing a Drupal 8 custom theme and notice the following CSS and JavaScript files are added automatically by Drupal, and you want to remove it .

CSS file

<link rel="stylesheet" href="/core/themes/stable/css/system/components/ajax-progress.module.css?owah24" media="all" />

<link rel="stylesheet" href="/core/themes/stable/css/system/components/align.module.css?owah24" media="all" />

<link rel="stylesheet" href="/core/themes/stable/css/system/components/autocomplete-loading.module.css?owah24" media="all" />

<link rel="stylesheet" href="/core/themes/stable/css/system/components/fieldgroup.module.css?owah24" media="all" />

<link rel="stylesheet" href="/core/themes/stable/css/system/components/container-inline.module.css?owah24" media="all" />

<link rel="stylesheet" href="/core/themes/stable/css/system/components/clearfix.module.css?owah24" media="all" />

<link rel="stylesheet" href="/core/themes/stable/css/system/components/details.module.css?owah24" media="all" />

<link rel="stylesheet" href="/core/themes/stable/css/system/components/hidden.module.css?owah24" media="all" />

<link rel="stylesheet" href="/core/themes/stable/css/system/components/item-list.module.css?owah24" media="all" />

<link rel="stylesheet" href="/core/themes/stable/css/system/components/js.module.css?owah24" media="all" />

<link rel="stylesheet" href="/core/themes/stable/css/system/components/nowrap.module.css?owah24" media="all" />

<link rel="stylesheet" href="/core/themes/stable/css/system/components/position-container.module.css?owah24" media="all" />

<link rel="stylesheet" href="/core/themes/stable/css/system/components/progress.module.css?owah24" media="all" />

<link rel="stylesheet" href="/core/themes/stable/css/system/components/reset-appearance.module.css?owah24" media="all" />

<link rel="stylesheet" href="/core/themes/stable/css/system/components/resize.module.css?owah24" media="all" />

<link rel="stylesheet" href="/core/themes/stable/css/system/components/sticky-header.module.css?owah24" media="all" />

<link rel="stylesheet" href="/core/themes/stable/css/system/components/system-status-counter.css?owah24" media="all" />

<link rel="stylesheet" href="/core/themes/stable/css/system/components/system-status-report-counters.css?owah24" media="all" />

<link rel="stylesheet" href="/core/themes/stable/css/system/components/system-status-report-general-info.css?owah24" media="all" />

<link rel="stylesheet" href="/core/themes/stable/css/system/components/tabledrag.module.css?owah24" media="all" />

<link rel="stylesheet" href="/core/themes/stable/css/system/components/tablesort.module.css?owah24" media="all" />

<link rel="stylesheet" href="/core/themes/stable/css/system/components/tree-child.module.css?owah24" media="all" />

JavaScript File

<script src="https://use.fontawesome.com/releases/v5.13.1/js/all.js'"></script>

<script src="core/misc/progress.js"></script>

<script src="core/misc/displace.js"></script>

Use below code for removing Stylesheet and JavaScript File

in custom_theme.info.yml add below line

For removing Stylesheet

libraries-override:

  system/base: false

OR

stylesheets-remove:

  - core/modules/system/css/components/ajax-progress.module.css

  - core/modules/system/css/components/align.module.css

  - modules/ajax_loader/css/throbber-general.css

  - core/modules/system/css/components/autocomplete-loading.module.css

  - core/modules/system/css/components/fieldgroup.module.css

  - core/modules/system/css/components/clearfix.module.css

  - core/modules/system/css/components/details.module.css

  - core/modules/system/css/components/item-list.module.css

  - core/modules/system/css/components/js.module.css

  - core/modules/system/css/components/nowrap.module.css

  - core/modules/system/css/components/container-inline.module.css

  - core/modules/system/css/components/position-container.module.css

  - core/modules/system/css/components/progress.module.css

  - core/modules/system/css/components/reset-appearance.module.css

  - core/modules/system/css/components/resize.module.css

  - core/modules/system/css/components/sticky-header.module.css

  - core/modules/system/css/components/system-status-counter.css

  - core/modules/system/css/components/system-status-report-counters.css

  - core/modules/system/css/components/tabledrag.module.css

  - core/modules/system/css/components/tree-child.module.css

  - core/modules/contextual/css/contextual.module.css

  - modules/select2boxes/css/select2boxes.theme.css

  - core/modules/views/css/views.module.css

  - core/modules/system/css/components/system-status-report-general-info.css

  - core/modules/system/css/components/tablesort.module.css

  - core/assets/vendor/jquery.ui/themes/base/core.css

  - core/assets/vendor/jquery.ui/themes/base/checkboxradio.css

  - core/assets/vendor/jquery.ui/themes/base/controlgroup.css

  - core/assets/vendor/jquery.ui/themes/base/resizable.css

  - core/assets/vendor/jquery.ui/themes/base/button.css

  - core/assets/vendor/jquery.ui/themes/base/dialog.css

  - core/modules/contextual/css/contextual.theme.css

  - core/modules/contextual/css/contextual.icons.theme.css

  - core/assets/vendor/jquery.ui/themes/base/theme.css

For JavaScript 

in theme.theme file use below code

function custometheme_js_alter(&$js) {

unset($js['https://use.fontawesome.com/releases/v5.13.1/js/all.js']);

unset($js['core/misc/progress.js']);

  unset($js['core/misc/displace.js']);

  //unset($js['themes/aeg/js/core.js']);

//echo "<pre>";

//print_r($js); die;

}

Explain how Drupal database system works

 Database server requirements

Required MySQL 5.5.3/MariaDB 5.5.20/Percona Server 5.5.8 or higher with InnoDB as the primary storage engine, and requires the PDO database extension.

Drupal 9 requires MariaDB 10.3+ or MySQL/Percona 5.7.8+.

Environment requirements of Drupal 9

If you are running Drupal 9 on Nginx, at least version 0.7.x is required.

If you are running Drupal 9 on Apache, at least version 2.4.7 is required.

Drupal 9 requires at least PHP 7.3. PHP 7.4 is also supported but not required. PHP 8 is supported from Drupal 9.1.0

Database backend requirements

If using Drupal 9 with MySQL or Percona, version 5.7.8+ is required.

If using Drupal 9 with MariaDB, version 10.3.7+ is required.

If using Drupal 9 with SQLite, version 3.26+ is required. (PHP 7.4 does not use the system provided SQLite, so take extra care to make sure your PHP is compiled with at least this version).

If using Drupal 9 with PostgreSQL, version 10 is required with the pg_trgm extension. 

Drupal Database

Drupal stores information in a database, each type of information has its own database table. For example the basic information about the nodes of your site are stored in the Node table, and if you use the CCK module to add fields to your content type, the field information is stored in separate tables . Comments and Users also have their own database tables, and roles, permissions, and other settings are also stored in database tables.




















Database abstraction layer

Drupal's database abstraction layer provides a unified database query API that can query different underlying databases. It is built upon PHP's PDO (PHP Data Objects) database API, and inherits much of its syntax and semantics.

The Drupal database layer is built on top of the PHP's PDO library. 

Because different databases require different sorts of interaction, the Drupal database layer requires a driver for each database type. A driver consists of a series of files located in includes/database/driver, where driver is a string representing the unique key for that driver. In most cases the driver key is the lowercase version of the database name, such as "mysql", "pgsql", or "mycustomdriver".

Connections

A connection is an object of class DatabaseConnection, which inherits from the PDO class. 

To access (and open if necessary) a connection object, use:

$database = \Drupal::database();

// Or

$database = \Drupal::service('database');

If services are not yet available, \Drupal\Core\Database\Database::getConnection() can get a database connection.

Database Configuration

Database connection is via the $databases array in settings.php.

The $databases array is a nested array of at least three levels. The first level defines the database keys. The second defines the database targets. The value of each target is the connection information for that key/target. Some examples should make that clearer.

$databases['default']['default'] = array(

  'driver' => 'mysql',

  'database' => 'drupaldb',

  'username' => 'username',

  'password' => 'secret',

  'host' => 'localhost',

);

Instantiating a Database Connection Object

Database interaction should be done via a database connection object.

The best way to instantiate a database connection object is via the Service Container.

Example:

$database = \Drupal::database();

// Or

$database = \Drupal::service('database');




Twig Filters

 Filters in Twig can be used to modify variables. Filters are separated from the variable by a pipe symbol. They may have optional arguments in parentheses. Multiple filters can be chained. The output of one filter is applied to the next.

Example:

{{ content|safe_join(", ")|lower }}

You may have to render an item before you filter it:

{{ item|render|filter }}

#Translation filters

This filter (alternatively, t) will run the variable through the Drupal t() function, which will return a translated string. This filter should be used for any interface strings manually placed in the template that will appear for users.

Example

<a href="{{ url('<front>') }}" title="{{ 'Home'|t }}" rel="home" class="site-logo"></a>

{% set name = '@label Introduction' |t({'@label': node.title.value}) %}

#placeholder

This filter escapes content to HTML and formats it using drupal_placeholder(), which makes it display as emphasized text.

Example

{% trans %}Submitted on {{ date|placeholder }}{% endtrans %}

#abs

The abs filter returns the absolute value.

Example 

{# number = -5 #}

{{ number|abs }}

{# outputs 5 #}

#batch

The batch filter "batches" items by returning a list of lists with the given number of items. A second parameter can be provided and used to fill in missing items:

{% set items = ['a', 'b', 'c', 'd'] %}

<table>

    {% for row in items|batch(3, 'No item') %}

        <tr>

            {% for column in row %}

                <td>{{ column }}</td>

            {% endfor %}

        </tr>

    {% endfor %}

</table>

The above example will be rendered as:

<table>

    <tr>

        <td>a</td>

        <td>b</td>

        <td>c</td>

    </tr>

    <tr>

        <td>d</td>

        <td>No item</td>

        <td>No item</td>

    </tr>

</table>

#date

The date filter formats a date to a given format:

{{ post.published_at|date("m/d/Y") }}

to display the current date, filter the word "now"

{{ "now"|date("m/d/Y") }}

#join

The join filter returns a string which is the concatenation of the items of a sequence

{{ [1, 2, 3]|join }}

{# returns 123 #}

The separator between elements is an empty string per default, but you can define it with the optional first parameter:

{{ [1, 2, 3]|join('|') }}

{# outputs 1|2|3 #}

A second parameter can also be provided that will be the separator used between the last two items of the sequence:

{{ [1, 2, 3]|join(', ', ' and ') }}

{# outputs 1, 2 and 3 #}

List of Main twig filter are below

abs

batch

capitalize

column

convert_encoding

date

date_modify

first

keys

lower

split

title

trim

upper

Difference between UNIQUE and PRIMARY key

MySQL Primary Keys

In MySQL, a primary key is a single field or combination of fields that uniquely defines a record. None of the fields that are part of the primary key can contain a NULL value. A table can have only one primary key.

In MySQL, a primary key is created using either a CREATE TABLE statement or an ALTER TABLE statement.

You use the ALTER TABLE statement in MySQL to drop, disable or enable a primary key.

MySQL Unique Key

A unique key in MySQL is a single field or combination of fields that ensure all values going to store into the column will be unique. It means a column cannot stores duplicate values. For example, the email addresses and roll numbers of students in the "student_info" table or contact number of employees in the "Employee" table should be unique.

MySQL allows us to use more than one column with UNIQUE constraint in a table. It can accept a null value, but MySQL allowed only one null value per column. It ensures the integrity of the column or group of columns to store different values into a table.

Needs of Unique Key

It is useful in preventing the two records from storing identical values into the column.

It stores only distinct values that maintain the integrity and reliability of the database for accessing the information in an organized way.

It also works with a foreign key in preserving the uniqueness of a table.

It can contain null value into the table.

Difference between Primary Key and Unique Key

Primary Key

Unique identifier for rows of a table

Cannot be NULL

Only one primary key can be present in a table

present in a table

Selection using primary key creates clustered index

Unique Key

Unique identifier for rows of a table when primary key is not present

Can be NULL

Multiple Unique Keys can be present in a table

present in a table

Selection using unique key creates non-clustered index


The syntax to create a primary key using the CREATE TABLE statement in MySQL is:

CREATE TABLE contacts

( contact_id INT(11) NOT NULL AUTO_INCREMENT,

  last_name VARCHAR(30) NOT NULL,

  first_name VARCHAR(25),

  birthday DATE,

  CONSTRAINT contacts_pk PRIMARY KEY (contact_id)

);

Create Primary Key - Using ALTER TABLE statement

ALTER TABLE contacts

  ADD CONSTRAINT contacts_pk 

    PRIMARY KEY (contact_id);

The following syntax is used to create a unique key in MySQL.

CREATE TABLE table_name(  

    col1 datatype,  

    col2 datatype UNIQUE,  

    ...  

);  

for creating more than one Unique Key

CREATE TABLE table_name(  

  col1 col_definition,  

  col2 col_definition,  

  ...  

  [CONSTRAINT constraint_name]  

  UNIQUE(column_name(s))  

);  


Difference between MyISAM and InnoDB

MYISAM

MYISAM supports Table-level Locking

MyISAM designed for need of speed

MyISAM does not support foreign keys hence we call MySQL with MYISAM is DBMS

MyISAM stores its tables, data and indexes in diskspace using separate three different files. (tablename.FRM, tablename.MYD, tablename.MYI)

MYISAM not supports transaction. You cannot commit and rollback with MYISAM. Once you issue a command it’s done.

MYISAM supports fulltext search

You can use MyISAM, if the table is more static with lots of select and less update and delete.

INNODB

InnoDB supports Row-level Locking

InnoDB designed for maximum performance when processing high volume of data

InnoDB support foreign keys hence we call MySQL with InnoDB is RDBMS

InnoDB stores its tables and indexes in a tablespace

InnoDB supports transaction. You can commit and rollback with InnoDB


MySQL Storage Engine

 A storage engine is a software module that a database management system uses to create, read, update data from a database. There are two types of storage engines in MySQL: transactional and non-transactional.

Storage engines are MySQL components that handle the SQL operations for different table types. InnoDB is the default and most general-purpose storage engine, and Oracle recommends using it for tables except for specialized use cases. (The CREATE TABLE statement in MySQL 8.0 creates InnoDB tables by default.)

MySQL Server uses a pluggable storage engine architecture that enables storage engines to be loaded into and unloaded from a running MySQL server.

To determine which storage engines your server supports, use the SHOW ENGINES statement. The value in the Support column indicates whether an engine can be used. A value of YES, NO, or DEFAULT indicates that an engine is available, not available, or available and currently set as the default storage engine.

MySQL 8.0 Supported Storage Engines

InnoDB

InnoDB is a general-purpose storage engine that balances high reliability and high performance. In MySQL 8.0, InnoDB is the default MySQL storage engine. Unless you have configured a different default storage engine, issuing a CREATE TABLE statement without an ENGINE clause creates an InnoDB table.

Advantages of InnoDB

Its DML operations follow the ACID model, with transactions featuring commit, rollback, and crash-recovery capabilities to protect user data.

Row-level locking and Oracle-style consistent reads increase multi-user concurrency and performance.

InnoDB tables arrange your data on disk to optimize queries based on primary keys. Each InnoDB table has a primary key index called the clustered index that organizes the data to minimize I/O for primary key lookups.

To maintain data integrity, InnoDB supports FOREIGN KEY constraints. With foreign keys, inserts, updates, and deletes are checked to ensure they do not result in inconsistencies across related tables.

MyISAM

These tables have a small footprint. Table-level locking limits the performance in read/write workloads, so it is often used in read-only or read-mostly workloads in Web and data warehousing configurations.

Memory

Stores all data in RAM, for fast access in environments that require quick lookups of non-critical data. This engine was formerly known as the HEAP engine. Its use cases are decreasing; InnoDB with its buffer pool memory area provides a general-purpose and durable way to keep most or all data in memory, and NDBCLUSTER provides fast key-value lookups for huge distributed data sets.

CSV

 Its tables are really text files with comma-separated values. CSV tables let you import or dump data in CSV format, to exchange data with scripts and applications that read and write that same format. Because CSV tables are not indexed, you typically keep the data in InnoDB tables during normal operation, and only use CSV tables during the import or export stage.

Archive: These compact, unindexed tables are intended for storing and retrieving large amounts of seldom-referenced historical, archived, or security audit information.

Blackhole

 The Blackhole storage engine accepts but does not store data, similar to the Unix /dev/null device. Queries always return an empty set. These tables can be used in replication configurations where DML statements are sent to replica servers, but the source server does not keep its own copy of the data.

NDB

 (also known as NDBCLUSTER): This clustered database engine is particularly suited for applications that require the highest possible degree of uptime and availability.

Merge

Enables a MySQL DBA or developer to logically group a series of identical MyISAM tables and reference them as one object. Good for VLDB environments such as data warehousing.

Federated

Offers the ability to link separate MySQL servers to create one logical database from many physical servers. Very good for distributed or data mart environments.

Example

This engine serves as an example in the MySQL source code that illustrates how to begin writing new storage engines. It is primarily of interest to developers. The storage engine is a “stub” that does nothing. You can create tables with this engine, but no data can be stored in them or retrieved from them.



TCS , WIPRO, HCL, Capgemini Drupal Interview Questions

What are advantages of Drupal

What are disadvantages of Drupal

Difference between Drupal 7 and 8

How to connect multiple database to Drupal


For PHP Interview question Click Here


MySql Interview questions and answers for freshers


What are the render arrays in Drupal

Drupal Nodes

Drupal Views

Drupal 8 theming concepts

How does cache works

How to improve performance of Drupal

What are the functionalities and usage of the Paragraph Module

Types of Cache in Drupal

Drupal 8 Cache tags

Conditional Filters in Drupal

How can I enable clean URLs in Drupal

Difference between Drupal 8 and Drupal 9

What is Drupal weight

Use of Composer in Drupal 8

What is DRUSH in Drupal

composer.json v/s composer.lock

What are the Events in Drupal

Twig Filters

PDO in Drupal

Hooks in Drupal

Git command to commit a code

Where session are store

Drupal routing

Views tpl

How to create a tpl for a particular content type in Drupal

Drupal 8 and Drupal 9 set cookie and get cookie example with symphony HttpFoundation Component

Use of template.php

How to theme a form in Drupal

What are contextual filters

Pathauto Module functionalities and usage

What are exposed filter in Views

What is taxonomy and Vocabulary in Drupal

What is hook_menu(), page arguments, page callback etc

Difference between Entity Query and DB (Database) Query.

What is Git

How to create a branch in Git

How to add JavaScript and CSS to Drupal

Can you explain how the database system of Drupal works

Which design pattern is used by Drupal

     Singleton Design pattern

What is design pattern

What is a render array in Drupal

Difference between UNIQUE and PRIMARY key

What is the difference between InnoDB and MyISAM

Which database engine used by Drupal

How to add a new field to user account? How to validate the same

How do I declare a new template file in my Drupal 8 theme

Drupal Page Call Process

Drupal Migrate from 8 to 9

What is services in drupal 8

 Dependency Injection

PHP annotations

How to create custom token

Disable cache for a block in Drupal 8

Batch Process in Drupal 8

Custom Batch Process Drupal 8 and Drupal 9

Drupal migration 7 to 8

What are environmental (.env) files

Contextual filter

What is Drupal queue

What is an entity queue

How do I create a queue in Drupal 8

Static Functions , Method and Static Variables in PHP

How To Start/Stop/Restart Cron Service In Linux

 If you are using Redhat /Fedora/ CentOS Linux login as root and use the following commands.


Start cron service

To start cron service, enter:

# /etc/init.d/crond start

Or

# service crond start

Stop cron service

To stop cron service, enter:

# /etc/init.d/crond stop

Or

# service crond stop

Restart cron service

To restart cron service, enter:

# /etc/init.d/crond restart

Or

# service crond restart



Start/Stop/Restart cron service in Debian/Ubuntu

If you are using Debian/Ubuntu Linux login as root and use the following commands.


Start cron service

To start cron service, enter:


# sudo /etc/init.d/cron start

Or

# sudo service cron start

Stop cron service

To stop cron service, enter:

# sudo /etc/init.d/cron stop

Or

# sudo service cron stop

Restart cron service

To restart cron service, enter:

# sudo /etc/init.d/cron restart

Or

# sudo service cron restart

Convert PHP Array To JSON

 JSON stands for JavaScript Object Notation. It consists of a series of key/value pairs. JSON is used to transfer the data between the server and the browser.

 PHP Array will also be converted into JSON. With the help of  PHP json_encode() function.

PHP json_encode()

PHP json_encode() is a built-in function that converts a PHP value to JSON value. Objects in PHP can be converted into JSON by using a function called json_encode(). The json_encode() function returns the string, if the function works.


Syntax - 

json_encode(value, options)

value - Required. Specifies the value to be encoded

options - Optional. Specifies a bitmask (JSON_FORCE_OBJECT, JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, JSON_INVALID_UTF8_IGNORE, JSON_INVALID_UTF8_SUBSTITUTE, JSON_NUMERIC_CHECK, JSON_PARTIAL_OUTPUT_ON_ERROR, JSON_PRESERVE_ZERO_FRACTION, JSON_PRETTY_PRINT, JSON_UNESCAPED_LINE_TERMINATORS, JSON_UNESCAPED_SLASHES, JSON_UNESCAPED_UNICODE, JSON_THROW_ON_ERROR)

Return value - Returns a JSON encoded string on success. FALSE on failure


Example 1- 


<?php
$fruit= array("Mango""Banana""Apple");

echo json_encode($fruit);
?>


Output - 

["Mango","Banana","Apple"]


Example 2-

<?php

$arr = array('Front' => 'Page', 

            'Fruit' => 'Apple', 

            'Tree' => 'Mango', 

            'Developer' => 'PHP'); 


echo json_encode($arr);
?>


Output - 

["Front":"Page","Fruit":"Apple","Tree":"Mango","Developer":"PHP"]




Importance of title and meta tags

 Title Tag

A title tag is an HTML element that specifies the title of a web page. Title tags are displayed on search engine results pages (SERPs) as the clickable headline for a given result, and are important for usability, SEO, and social sharing. The title tag of a web page is meant to be an accurate and concise description of a page's content.

Code sample

<head><title>Example Title</title></head>


Meta Tags

Meta tags are pieces of information you use to tell the search engines and those viewing your site more about your page and the information it contains. Meta tags include:

Title tags:  the title of your page, which should be unique for every page you publish

Meta description:  a description of the content on the page

Viewport tag:  impacts how your content appears on mobile devices

Robots:  can be used to indicate content that you want a “noindex” or a “nofollow”

Hreflang tags:  allows the search engine to identify the language and country you want content displayed for when you have an international audience

Canonical tags:  used to specify the primary or principle version of the page

Open graph tags: used to specify which assets show up in title and image by default when sharing links on social sites

Content type:  impacts how your page is rendered in the browser

Meta tags have varying levels of importance for brands based upon the type of content being produced and how you want the material indexed. Given that meta tags are pieces of code, it is generally recommended that you do not include tags that you do not need but that any tags that are important for your goals should not be neglected.


Add / Remove user role programmatically in Drupal 8

 For this we need to load a user first

<?php

use Drupal\user\Entity\User;

// pass the correct user id here.

User:load(4); 


or you can load current user

<?php

use Drupal\user\Entity\User;

User::load(\Drupal::currentUser()->id());


Then we add a user role 

// pass machine name of the user.

$user->addRole('administrator');

$user->save();

To remove the role we can use this code

// pass machine name of the user.

$user->removeRole('administrator');

$user->save();

Drupal Fatal error Class 'PDO' not found in Drupal/Core/Database/Driver/mysql/Connection.php

 Below a steps required to fix the above issue.

Step 1-  Enable PDO in your php.ini file 

Step 2-  open php.ini file add below line

extension=pdo.so

extension=pdo_sqlite.so

extension=pdo_mysql.so

extension=sqlite.so


Once you made this change kindly restart your DB Server. After that you refresh your website.


overriding views-view-unformatted.html.twig - theming views-view-unformatted.html.twig in Drupal 8, 9

If u want to add custom html in views and custom html for field follow the below step.

1.  copy views-view-unformatted.html.twig from core/views/templates and paste in your custom theme folder .


overriding views-view-unformatted.html.twig - theming views-view-unformatted.html.twig in Drupal 8, 9



overriding views-view-unformatted.html.twig - theming views-view-unformatted.html.twig in Drupal 8, 9












2. if you want to theme for a particular  view/ page naming convention below

views-view-unformatted--[view name]--[page/block id].html

suppose I have View name is [exhibition_resources] and page id [page_1] custom view twig tpl name is

views-view-unformatted--exhibition-resources--page-1.html.twig

overriding views-view-unformatted.html.twig - theming views-view-unformatted.html.twig in Drupal 8, 9













for print field value follow below code

{{row.content['#row']._entity.field machine name.value}}

for getting image and pdf url kindly use below code

{{file_url(row.content['#row']._entity.field_pdf.entity.fileuri)}}









Write a program in PHP to reverse a number

A number can be written in reverse order. For example 12345 = 54321 <?php   $ num = 23456;   $ revnum = 0;   while ($ num > 1)   {   $...