13 Most Importent Drupal interview questions for experienced Drupal Developer

1. what is element and element programming interface?

Ans: They furnish a brought together approach to work with various information units in Drupal. Drupal 7 is about substances. They are all over: hubs, clients, scientific categorization terms, vocabularies…https://53f6381e9d70f4cfdcdd71d6b48d3d20.safeframe.googlesyndication.com/safeframe/1-0-38/html/container.html

Yet, how, as designers, would we be able to make our own substances? When do we truly have to do that? I think these inquiries are actually quite project-explicit. We can presumably utilize hubs for almost everything. Be that as it may, with regards to execution delicate ventures, hubs ought to truly just be utilized for content, and we should separate however much as could reasonably be expected from hubs. Why? Hubs are revisioned, they fire a great deal of snares, and they have usefulness that we probably will not require. Likewise in the event that we know precisely what fields we ought to have in our substances, we can make our own custom elements to stay away from that load of joins of Field API tables.

2. The most effective method to do the for drupal investigating

Ans:

Basic utilizing print_r or var_export , you can investigate code inside Drupal.

Drupal devel module gives dsm and dpm capacities to investigate code inside drupal.

Drupal most recent rendition gives troubleshoot inbuilt capacity to print blunders, notification and admonitions too.

This could be in the page or in the logs relying upon how php is arranged.

For instance

The full alternatives for investigate work are:

debug($data, $label, $print_r);

The $data is really simple. It very well may be anything you could go through print_r or var_export. The $label takes into account a custom mark to be added.

This is ideal when you are sending the data to a log and you need a key to scan the logs for. The third contention is whether to utilize print_r or var_export. The default is var_export.

In case you are intrigued between the two I’d propose perusing the manual pages

Read This:iphone emulator for pc windows 103. Which records are needed for topic?

Ans:

style.css, page.tpl.php, information record, template.php, node.tpl.php, block.tpl.php

4. Which documents are needed for module?

Ans:

modulename.info, modulename.module, discretionary modulename.install

5. What is Drush – how drush is utilized?

Ans: Drush is an order line shell and prearranging interface for Drupal, an authentic Swiss Army blade intended to make life simpler for those of us who invest a portion of our functioning hours hacking away at the order brief.

6. Where to utilize the topic snare?

Ans: template.php in topic envelope

7. What is utilization of template.php record?

Ans: Overriding other subject capacities. Assuming you need to abrogate a topic work excluded from the essential rundown (block, box, remark, hub, page), you need to inform PHPTemplate concerning it.

To do this, you need to make a template.php record in your topic’s index. This record should begin with a PHP opening tag

You may Like This:front end developer interview questions and answers8. What is subtheme?

Ans: A Drupal subtheme (or sub-subject) is a topic that depends on a “base topic”. The base subject gives essential (and in some cases more than fundamental) usefulness. The subtheme styles the site with a novel look, and adds any interesting additional usefulness.

9. How to utilize the various topics in a single venture?

Ans: utilize the worldwide variable, default_theme.

10. How might we set the locale in drupal subject?

Ans:

You can set the locales in themename.info record.

regions[header] = Header

regions[content_header] = Content Header

regions[content] = Content

regions[sidebar_second] = Right sidebar

Also Read This:Best react interview questions answered11. How to make the table utilizing module?

Ans: Use following code:

/**

* Implements hook_schema().

*/

work module_name_schema() {

$schema[‘module_name’] = cluster(

‘fields’ => cluster(

‘type’ => array(‘type’ => ‘varchar’, ‘length’ => 15, ‘not invalid’ => TRUE, ‘default’ => ‘hub’),

‘id’ => array(‘type’ => ‘int’, ‘unsigned’ => TRUE, ‘not invalid’ => TRUE, ‘default’ => 0),

‘module_name’ => array(‘type’ => ‘varchar’, ‘length’ => 255, ‘not invalid’ => TRUE, ‘default’ => “)

),

‘essential key’ => array(‘type’, ‘id’),

);

return $schema;

}

/**

* Implements hook_uninstall().

*/

work module_name_uninstall() {

/Clear factors

variable_del(‘module_name_default’);

}

How to refresh table utilizing module?

Ans: You can actually take a look at the accompanying code:

/**

* Implements hook_update_n().

*/

work module_name_update_6200() {

$ret = exhibit();

on the off chance that (db_column_exists(‘module_name’, ‘id’)) {

return $ret;

}

db_create_table($ret, ‘module_name_temp’, exhibit(

‘fields’ => exhibit(

‘type’ => array(‘type’ => ‘varchar’, ‘length’ => 15, ‘not invalid’ => TRUE, ‘default’ => ‘hub’),

‘id’ => array(‘type’ => ‘int’, ‘unsigned’ => TRUE, ‘not invalid’ => TRUE, ‘default’ => 0),

‘module_name’ => array(‘type’ => ‘varchar’, ‘length’ => 255, ‘not invalid’ => TRUE, ‘default’ => “)

),

‘essential key’ => array(‘type’, ‘id’),

));

$ret[] = update_sql(‘INSERT INTO {module_name_temp} (id, module_name) SELECT nid, module_name FROM {module_name}’);

db_rename_table($ret, ‘module_name’, ‘module_name_old’);

db_rename_table($ret, ‘module_name_temp’, ‘module_name’);

$display_settings = variable_get(‘module_name_display’, array());

foreach ($display_settings as $type) {

on the off chance that ($type) {

variable_set(‘module_name_type_’ . $type . ‘_showfield’, 1);

}

}

variable_del(‘module_name_display’);

return $ret;

}

12. How to drop the table utilizing module?

Ans: Use db_drop_table technique in introduce document

13. Which snares you utilized and what is the reason for utilizing the those snares?

Ans: Drupal’s module framework depends on the idea of “snares”. A snare is a PHP work that is named foo_bar(), where “foo” is the name of the module (whose filename is in this manner foo.module) and “bar” is the name of the snare. Each snare has a characterized set of boundaries and a predetermined outcome type.

Snares are the manner by which modules can interface with the center code of Drupal. They make it workable for a module to characterize new urls and pages inside the site (hook_menu), to add content to pages (hook_block, hook_footer, and so on), to set up custom information base tables (hook_schema) and then some. This page records the snares gave in the center, yet modules can characterize snares of their own. For instance the cck module characterizes hook_field_info, which can be utilized by modules that need to characterize another sort of content field. Most modules that characterize snares will likewise give documentation about them.

For instance, assuming the module document is called example.module, hook_help() as carried out by that module would be characterized as example_help().

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Ctrlr