Drupal Upwork Test

Which of the following is the correct way to create dummy nodes for specific content type ?

drupal create:content [arguments] [options]

drupal create:nodes [arguments] [options]

drush create:content [arguments] [options]

None of the above

To create our own Controller, we need to extend it from the following Controller Class:

BaseController

ControllerBase

Controller

ControlController

Which of the following notifications pertain to the new versions of Drupal and contributions?

Update status

Status Update

Update

Status

Which function is used to activate the DB?

db_active()

db_activate()

db_set_active()

set_db_active()

How can you slide the content title in Drupal?

Using Module and Slick_views controller

Using Slick and Slick_views Views

Using Slick and Slick_views module

None of the above

Which of the following are valid values of 'requirements' property In module.routing.yml?

Note: There may be more than one right answer.

_permission

_role

_csrf_token

_form

What is a theme suggestion in Drupal theming?

Theme suggestions suggest to the Drupal admin how a theme will best look and it offers HTML, CSS, and Jquery.

Theme suggestions change the look of a specific node and they re-style views, blocks, and pages.

Theme suggestions suggest the best way to present a theme to the user.

Theme suggestions suggest which Drupal theme to download from Drupal.org

CacheArray is in the process of being replaced by CacheCollector in ____?

Drupal 5

Drupal 6

Drupal 7

Drupal 8

Which of the following can be used to inspect variables in twig? (Check all that apply)

Note: There may be more than one right answer.

{{ dump() }}

{{ kint() }}

{{ dpm() }}

{{ dsm() }}

Which of the following can be used to fetch values sent programmatically to the view?

Filter Criteria

Contextual Filter

Exposed Form

None of the above

Drupal users are grouped into what?

User Groups

Ranks

Roles

Teams

Which of the following Menu types are not provided by views?

Normal menu entry

Default menu tab

Menu tab

Block menu

Which is the correct way to attach Libraries in THEME.info.yml?

name: custom_theme

type: theme

description: Amazing Custom Theme

package: Other

core: 8.x

libraries:

- custom_theme/global-styling

- custom_theme/views

- custom_theme/header_footer

name: custom_theme

type: theme

description: Amazing Custom Theme

package: Other

core: 8.x

libraries:

custom_theme/global-styling

custom_theme/views

custom_theme/header_footer

name: custom_theme

type: theme

description: Amazing Custom Theme

package: Other

core: 8.x

libraries: custom_theme/global-styling, custom_theme/views, custom_theme/header_footer

Which of the following is used by default by Drupal's caching API?

Database

PHP

Server

Local

Which one of the following is the correct way to discover valid theme hook suggestions?

Install and enable Devel module

Enable Twig debugging mode

Write custom module

Enable Webprofiler module

Which of the following is/are correct to execute cron implementations by module?

Note: There may be more than one right answer.

drupal execute MODULE_NAME

drupal cre MODULE_NAME

drupal cron MODULE_NAME

drupal cron:execute MODULE_NAME

Which of the following APIs are provided by Drupal? (Check all that apply)

Note: There may be more than one right answer.

Authentication API

Block API

RESTful Web Services API

Tour API

Which of the following is the correct way to attach a library in a Drupal Module?

use ['#attached'] property

drupal_add_js() and drupal_add_library()

Both of the above

None of the above

Which of the following options are provided by Drupal to increase performance? (Check all that apply)

Note: There may be more than one right answer.

Aggregate JavaScript files

Aggregate CSS files

Views Caching

Load jQuery only when it is needed

The minimum requirements for a custom module are:

A folder [CUSTOM_MODULE] in the module directory with the file [CUSTOM_MODULE].info in it.

A folder [CUSTOM_MODULE] in the module directory with the files [CUSTOM_MODULE].info and [CUSTOM_MODULE].install in it.

A folder [CUSTOM_MODULE] in the module directory with the files [CUSTOM_MODULE].info and [CUSTOM_MODULE].module in it.

A folder [CUSTOM_MODULE] in the module directory with the files [CUSTOM_MODULE].module and [CUSTOM_MODULE].install

Which is the correct way to list all routes?

drupal router:debug

drupal router:all

drupal router:list-all

drupal route:all

Which is the correct option to include CSS or JS files in a Drupal Module?

Save the CSS or JS to a file.

Define a "library", which can contain both CSS and JS files.

"Attach" the library to a render array in a hook.

Use add_js and add_cs function in module file

Use hook_library_info() in module file

All of the above

Which of the following permissions are defined by Configuration Manager? (Check all that apply)

Note: There may be more than one right answer.

Export configuration

Import configuration

Administer configuration

Synchronize configuration

Which of the following pager settings are provided by views? (Check all that apply)

Note: There may be more than one right answer.

Display a specified number of items

Display all items

Paged output, styled pager

Paged output, mini pager

What is the best way to add category fields to a Drupal content type?

Tags

Categories

Taxonomy

Modules

Which of the following is the correct way to remove whitespace between HTML tags in Twig template?

{% removespace %}

<div class="code">

<strong>foo</strong>

</div>

{% endremovespace %}

{%- removeblanks -%}

<div class="code">

<strong>foo</strong>

</div>

{%- endremoveblanks -%}

{%- removespace -%}

<div class="code">

<strong>foo</strong>

</div>

{%- endremovespace -%}

{% spaceless %}

<div class="code">

<strong>foo</strong>

</div>

{% endspaceless %}

Which of the following is a blog for every user?

Blog

Page

Post

Modular

Which of the following shows helpful toolbar at the bottom of every page?

Devel

Webprofiler

Drupal console

Watchdog

Which of the following is the correct way of debugging a Drupal application?

Use debug module

Use xdebug application

<?php

$node = node_load(123);

print_e(node);

?>

All of the above

In Drupal, ______ arrays provide you a structured way to ___________ change the content ____________ it is displayed.

Render, Programmatically, before

2D, Programmatically, after

2D, Programmatically, before

Render, manually, before

You have a view of teasers of a content type containing a referenced ID to a taxonomy term. You want each node in the view to show several fields of that taxonomy term. Which of the following would be best practice if you would do it programmatically?

In the node—teaser template use the referenced ID to load the taxonomy term as an entity and render the wanted fields.

In the views row template use the referenced ID to load the taxonomy term as an entity and render the wanted fields.

In the views field template use the referenced ID to load the taxonomy term as an entity and render the wanted fields.

In the template.php file through the hook_preprocess_node() function load the needed fields and put them in a variable.

Which code can be used to remove the strange text of Taxonomy Term?

function THEME_preprocess_page(&$vars) {

if(isset($vars['page']['content']['system_main']['no_content'])) {

unset($vars['page']['content']['system_main']['no_content']);

}

}

function THEME_preprocess_page(&$vars) {

if(isset($vars['module']['content']['system_main']['no_content'])) {

unset($vars['module']['content']['system_main']['no_content']);

}

}

function THEME_preprocess_page(&$vars) {

if(!isset($vars['page']['content']['system_main']['no_content'])) {

unset($vars['page']['content']['system_main']['no_content']);

}

}

function THEME_preprocess_page(&$vars) {

if(isset($var['page']['content']['system_main']['no_content'])) {

unset($vars['page']['content']['system_main']['no_content']);

}

}

Which of the following is used for organizing content?

Term

Category

Theme

Taxonomy

Which of the following are required properties for route definition in module.routing.yml? (Check all that apply)

Note: There may be more than one right answer.

path

defaults

requirements

options

Which option applies in order to change Public file base URL?

Drupal provides User Interface to change Public file base URL

Public file base URL can be changed using settings.php

It can not be changed

Public file base URL can be changed using template.php

Which of the following is the correct way to alter existing routes?

Existing routes can not be altered

Use hook_menu

Use hook_menu_alter

By implementing the alterRoutes(RouteCollection $collection) method of class \Drupal\Core\Routing\RouteSubscriberBase

Drupal has over _____ plug-ins to boost your website?

1000

2000

4000

5000

7000

Which file is required to create a Drupal 8 Module?

MODULE_NAME.module

MODULE_NAME.info

MODULE_NAME.info.yml file (aka, "info yaml file") is required and ensure file has type: module

None of the above

In custom module, routes are defined in:

MODULENAME.routing.yml

MODULENAME.info.yml

MODULENAME.routes.yml

MODULENAME.module

Which of the following can be used to attach a library in twig template?

attach_library()

drupal_add_js()

drupal_add_library()

None of the above

Which of the following are properties of render array? (Check all that apply)

Note: There may be more than one right answer.

#type

#cache

#markup

#plain_text

Which of the following controls content in sidebars?

Blog

Book

Dblog

Block

Drupal 8 is built on _____________ framework?

Symfony

Zend

Laravel

Yii 2

Drupal Test Upwork 2019

