Your Personal Checklist For Hiring A Dedicated Drupal Developer

Hire Drupal Developer

The hunt for a decent Drupal developer has never been a child’s play. One, because Drupal in itself is a complex tool that requires a high-end expertise and hence Drupal developers are less in number as compared to others. And second, one also has to be technically literate to a certain extent, in order to sense their expertise and hire accordingly.

Well, you need not be scared, if you aren’t that well-versed about the tech-world. Especially, when you have AddWeb Solution to your rescue. We, being a pack of powerful Drupal-ers since 2012 and currently ranked at the 24th position in the marketplace of Drupal Service Provider, you know that you can put faith in our words. And as always, we’re more than happy to guide you through your search of a good Drupal developer.

Let us share a few pointers that have to be on your checklist while shortlisting a Drupal developer for yourself.

1) Profile on Drupal community:

What better recommendation of a Drupal developer than the one coming from Drupal’s official website itself?! And guess what, Drupal doesn’t bluff! It purely works on the merit basis, where the Drupal developers’ activeness in the community and their contribution is displayed. If one doesn’t have a profile on Drupal Community, you know you’ve to think twice before hiring them!

2) Certification:

“Skills, not degrees, take you far.” True. But when in the ever-changing techno-world, you can’t shun the significance of certificates that these software companies give. So, if you come across a certified Drupal developer by Acquia, you know you’ve found the best champ to hire.

3) Work Profile:

Remember, that work speaks for itself! Well, don’t let some fraud deceive you with pretty presentations and flattery words. Ask for their work profile and invest your time and energy over analyzing them. And you’ll soon be a judge yourself, whether to trust the person or not. No wonder why a lot of companies goes all boastful about their clientele.

4) Coding Languages:

“The more the merrier” is the mantra you need to follow while choosing a Drupal Developer with the knowledge of multiple coding languages. Since Drupal is built with the PHP language, it becomes mandatory for a Drupal developer to be well-versed in it. But knowing just PHP is also not enough, he needs to be multilingual when it comes to coding languages; majorly, SQL, MYSQL, JQuery, et al. And of course, not to forget ‘English’. It may not have any technical benefit attached to it, but it will surely enhance your communication with him!

5) Activeness on Drupal Community:

Drupal is a high-end open-source content-management framework, which is available free of cost. But the prominent reason behind its growth and flourishment is its community. People from all across the world, gather-up here and share their knowledge and queries here. A Drupal developer’s activeness here in this community also speaks for the wealth of his Drupal-related knowledge.

There may not be a guaranteed checklist to help you hire only the best of Drupal developers, but a few tips like these can always prevent you from a disastrous selection. And in case, you’re still stuck in your search; remember, our super-skilled Drupal developer’s team is just a call away!

May you have a happy ride, searching a decent Drupal developer!Article Source: AddWeb Solution

Advertisements

Building Custom Solr Query

Building Custom Solr Query

Solr search has great performance, is suitable even for use on large commercial websites and supports facets and multi-index searches. What if we want to build your own query or get all indexed nodes programmatically?

Yes, building the custom query for Solr content will solve the problem.

Benefits of custom Solr Query

  1. Reduces load time.
  2. Custom filters.

1. Initialize solr api query using your index name

// To get index field value
$public_index = “Name of your Index”
$index = search_api_index_load($public_index);
$query = new SearchApiQuery($index);

2. Building filter, you can add multiple filters in your query

// Build a filter.
$node_filter = $query->createFilter('AND');
$node_filter->condition('type', 'content_type', '=');
$node_filter->condition('status', NODE_PUBLISHED, '=');

3. Adding filters to query

// Added filter in query.
$filter->filter($node_filter);
$query->filter($filter);

4. Fetch results of custom query

// Fetch results.
$results = $query->execute()['results'];
$arr_nodes = array_keys(return $arr_node$results);
Hope this helped you to get most out of the system, feel free to share your reviews and Pick the best answer for your requirements.

Original Post: Building Custom Solr Query

Introduction To Bootstrap Paragraph Drupal 8

Bootstrap Paragraph Drupal 8

Paragraphs

Paragraphs are one of the modules that make site builder and end users more powerful. Paragraph module does this by replacing one big WYSIWYG with predefined paragraph types. Paragraph module utilizes entity reference field to reference paragraph types. Paragraphs are basically entities so users get control over fields and theming of the paragraph.

Bootstrap 

Bootstrap is sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development. Bootstrap has become one of the most popular front-end frameworks and open source projects in the world.

A combination of these two is “Bootstrap Paragraph” module.

“The Bootstrap Paragraphs module provides a suite of content and layout Paragraph bundles made with the Bootstrap front-end framework.”

Using bootstrap paragraph module, it is very easy to create features like an accordion, modals, tabs, multi-column layouts, and many more things.

The module has multiple dependencies including paragraphs, Entity reference revisionscontact formatter to name a few. The module also needs Bootstrap framework’s js and CSS added in site theme. Installing this module via composer could be beneficial.

Module installation follows a standard process. The module comes with predefined paragraph bundles which can be accessed from /admin/structure/paragraphs_type. These paragraph bundles are divided into 2 main categories:

Content bundles

  • Simple HTML
  • Image
  • Blank
  • Contact Form
  • Drupal Block
  • View

Layout bundles

  • Accordion
  • Carousel
  • Columns (Even, up to 6)
  • Columns (3 Uneven)
  • Columns (2 Uneven)
  • Modal
  • Tabs

Each paragraph type comes with 2 options:

Width and background color

Bootstrap Paragraph Drupal 8

Over 50 background colors are already defined. Empty background classes are also available to customize based on your theme. These classes are :

  • .paragraph–color–primary
  • .paragraph–color–secondary
  • .paragraph–color–success
  • .paragraph–color–info
  • .paragraph–color–warning
  • .paragraph–color–danger

Predefined width options include following:

  • Tiny – col-4, offset-4
  • Narrow – col-6, offset-3
  • Medium – col-8, offset-2
  • Wide – col-10, offset-1
  • Full – col-12

To use these paragraph bundles, an entity reference field referencing to paragraph needs to be added to a content type. This field can have unlimited value to allow site builders to add as many paragraphs as they want. Once set you can start creating content. With this module, you can place a piece of content in your own structured page.

Additional Features

  • Paragraphs and fields are saved in the database. This means that whatever changes are made in them are also in the database.
  • Theme CSS gets precedence over module CSS. You can copy template files in theme from a module and overwrite CSS as you desire.
  • The module can be uninstalled without losing paragraphs and CSS. You need to move all templates and CSS to your theme. Remove “attach_library” calls from template files and call CSS from theme’s library.
  • You can use this module to create reusable paragraph bundles via a module.

To summarize, Bootstrap paragraph module is a suite of Paragraph bundles made with the Bootstrap framework. With this module, you can easily position chunks of content (Paragraph bundles) within a structured layout of your own design.

Hope this blog helped you and explore more about Paragraphs also need assistance for Drupal 8 Services then get in touch with us Feel free to share feedback.

Original Post: Introduction to Bootstrap Paragraph Drupal 8

Guidelines for Updating Node Fields Without node_save() In Drupal

Guidelines for Updating Node Fields Without node_save() In Drupal

Customization is nowadays common on Drupal site. Here you may need to save node programmatically at any time. For saving node programmatically we use node_save() hook which will save the whole node though we want to update only one field.

Drupal function field_attach_update() will replace node_save() in some way. It will update only that field which you want to update.

Benefits of field_attach_update()

  1. Reduces load time.
  2. Not update CCK fields.
  3. Easy to use.

Below is the code to use field_attach_update() hook.

// $arr_nids is array of node id that you want to update
$arr_nodes = node_load_multiple($arr_nids);
foreach ($arr_nodes as $key => $node) {
$node->field_fieldname1[LANGUAGE_NONE][0]['value'] = 'field1 value';
$node->field_fieldname2[LANGUAGE_NONE][0]['value'] = 'field2 value';
$node->field_fieldname3[LANGUAGE_NONE][0]['value'] = 'field3 value';

field_attach_update('node', $node);
entity_get_controller('node')->resetCache(array($node->nid));
}

entity_get_controller(‘node’)->resetCache(array($node->nid)) is used to clear cache for the entity.

For example:

Values before using field_attach_update():

Guidelines for Updating Node Fields Without node_save() In Drupal

Update Fields using field_attach_update():

$nid = '29';
$node = node_load($nid);
$node->field_fname[LANGUAGE_NONE][0]['value'] = 'Johnny1';
$node->field_lname[LANGUAGE_NONE][0]['value'] = 'Harper1';
$node->field_address[LANGUAGE_NONE][0]['value'] = '405, Silicon Tower, Above Freezland Restaurant, Law Garden, Off C.G. road, Ahmedabad, Gujarat - 380009 India.';

field_attach_update('node', $node);
entity_get_controller('node')->resetCache(array($node->nid));

Values after using field_attach_update():

Guidelines for Updating Node Fields Without node_save() In Drupal

Hope this helped you to get most out of the system. Need more assistance for Drupal Development Services then get in touch with us. Feel free to share your reviews and pick the best answer for your requirements. #WeDrupalEveryday

Introduction to Paragraphs Drupal 8

Precious Tips For Paragraphs In Drupal 8 Web Services
Paragraphs is a contributed module which allows creation, administration, and display of customization content components.

In other words, Paragraphs gives you cleaner data structures so you can give more editing power to your end-users.

This module replaces drupal’s standard body field with paragraph types. This allows any type of content to be added on

the page including but not limited to HTML, images, videos etc. All these can be added by users. Users can add as many

paragraphs as they like all the while keeping them all responsive. Developers can reuse paragraphs and layouts.

Paragraphs are basic Drupal entities. This allows site builder control over fields used in paragraphs and their display.

This also makes content saved in paragraphs compatible with Search API, views, and services.

Below is the step by step instructions to work with Paragraphs module:

1 – Download and enable the module
Paragraphs module follows standard process to download and enable.  Module depends on entity reference revision.

You can download and enable this module via drush as well.

2 – Add paragraph types
Paragraphs do not come with any predefined paragraph types. Developers can add as many paragraph types they want by going to admin > structure > paragraphs

To add a paragraph, click on “Add paragraph”. Add fields


Add fields that you want in this paragraph. Go to manage form display and manage display to adjust field display.

3 – Add paragraph field in the content type

paragraph-field.png

Allow this field to have multiple values. Select which paragraphs you want available in this field on field settings and save.

4 – Add content

Add content. In paragraph field, you get a list of all the paragraphs you have created and are available for this field.

Add as many paragraphs as you need.

You can change the order as well.

5 – Theme your paragraphs

Paragraphs can be themed separately. You can use the same template everywhere this paragraph is used.

The file name needs to

“Paragraph–machine-name-of-your-paragraph.html.twig”

Summary

Paragraph provides various advantages to all users of the site. Site owners get content that is responsive and works on all platforms.

Content authors can choose on the fly between predefined paragraph types. They get more structured content creation process.

Developers have full control over fields to include and paragraphs and how they should look.

Stay tuned for more on paragraphs!

Hope this helped you to get most out of the system. Feel free to share your reviews or need assistance for

Drupal Website Migration then gets in touch with us. Pick the best answer for your requirements.

Create Custom Multistep Form Using Ajax

Multistep Form Using Ajax
Don’t want long forms on your website? Convert it into multi-step form, as it is more convenient and provides step by

step procedure to follow by user. This blog will provide a way to create of multi step form using ajax.

https://goo.gl/P1BrVx 1. Create a menu item using hook_menu()

/** * Implementation of hook_menu(). */ function custom_menu() { $menu[‘multistep_form’] = array ( ‘title’ => ‘Multistep Form’, ‘description’ => ‘To create multistep form’, ‘page callback’ => ‘drupal_get_form’, ‘page arguments’ => array(‘ajax_multistep_form’), ‘access callback’ => TRUE, ); return $menu; }

  1. Define a callback functionIt includes stepwise fields. It contains fieldset for each step with their respective fields. Then It will includes buttons for each step.

We have called ajax_multistep_form_ajax_callback function it returns the entire form each time the function is called. Added a wrapper div “ajax_multistep_form’” to update the form using AJAX.

$form[‘buttons’][‘next’] = array ( ‘#type’ => ‘submit’, ‘#value’ => t(‘Next’), ‘#ajax’ => array ( ‘wrapper’ => ‘ajax_multistep_form’, ‘callback’ => ‘ajax_multistep_form_ajax_callback’, ), );

 

 

function ajax_multistep_form($form, &$form_state) {   // If $form_state[‘step’] is not set then set default to 1 $form_state[‘step’] = isset($form_state[‘step’]) ? $form_state[‘step’] : 1; // Add a wrapper div to update the form using AJAX $form[‘#prefix’] = ‘

‘; $form[‘#suffix’] = ‘

‘;   switch($form_state[‘step’]) { // Step 1 case 1: $fname_default_value = $lname_default_value = ”; if(isset($form_state[‘values’][‘step_1’])) { $fname_default_value = $form_state[‘values’][‘step_1’][‘fname’]; $lname_default_value = $form_state[‘values’][‘step_1’][‘lname’]; } elseif(isset($form_state[‘storage’][‘step_1’])) { $fname_default_value = $form_state[‘storage’][‘step_1’][‘fname’]; $lname_default_value = $form_state[‘storage’][‘step_1’][‘lname’]; }   $form[‘step_1’] = array( ‘#type’ => ‘fieldset’, ‘#title’ => t(”), ‘#collapsible’ => false, ‘#collapsed’ => false, ); $form[‘step_1’][‘fname’] = array( ‘#type’=>’textfield’, ‘#required’ => true, ‘#title’=>t(‘First Name’), ‘#default_value’ => $fname_default_value, ); $form[‘step_1’][‘lname’] = array( ‘#type’=>’textfield’, ‘#required’ => true, ‘#title’=>t(‘Last name’), ‘#default_value’ => $lname_default_value, ); break; // Step 2 case 2: $phone_default_value = ”; if(isset($form_state[‘values’][‘step_2’])) { $phone_default_value = $form_state[‘values’][‘step_2’][‘phone’]; } elseif(isset($form_state[‘storage’][‘step_2’])) { $phone_default_value = $form_state[‘storage’][‘step_2’][‘phone’]; }   $form[‘step_2’] = array( ‘#type’ => ‘fieldset’, ‘#title’ => t(”), ‘#collapsible’ => false, ‘#collapsed’ => false, ); $form[‘step_2’][‘phone’] = array( ‘#type’=>’textfield’, ‘#required’ => true, ‘#title’=>t(‘Phone Number’), ‘#default_value’ => $phone_default_value, ); break; // Step 3 case 3: $city_default_value = $city_default_value = ”; if(isset($form_state[‘values’][‘step_3’])) { $street_default_value = $form_state[‘values’][‘step_3’][‘street’]; $city_default_value = $form_state[‘values’][‘step_3’][‘city’]; } elseif(isset($form_state[‘storage’][‘step_3’])) { $street_default_value = $form_state[‘storage’][‘step_3’][‘street’]; $city_default_value = $form_state[‘storage’][‘step_3’][‘city’]; }   $form[‘step_3’] = array( ‘#type’ => ‘fieldset’, ‘#title’ => t(”), ‘#collapsible’ => false, ‘#collapsed’ => false, ); $form[‘step_3’][‘street’] = array( ‘#type’=>’textfield’, ‘#required’ => true, ‘#title’=>t(‘Street Address’), ‘#default_value’ => $street_default_value, );   $form[‘step_3’][‘city’] = array( ‘#type’=>’textfield’, ‘#required’ => true, ‘#title’=>t(‘City’), ‘#default_value’ => $city_default_value, );   }     // Form Buttons $form[‘buttons’] = array ( ‘#type’ => ‘container’, ); // If we are on step 1, we do not want a back button if($form_state[‘step’] !== 1) { $form[‘buttons’][‘back’] = array ( ‘#type’ => ‘submit’, ‘#value’ => t(‘Back’), ‘#limit_validation_errors’ => array(), ‘#submit’ => array(‘ajax_multistep_form_back_submit’), ‘#ajax’ => array ( ‘wrapper’ => ‘ajax_multistep_form’, ‘callback’ => ‘ajax_multistep_form_ajax_callback’, ), ); }   if($form_state[‘step’] !== 3) { $form[‘buttons’][‘next’] = array ( ‘#type’ => ‘submit’, ‘#value’ => t(‘Next’), ‘#ajax’ => array ( ‘wrapper’ => ‘ajax_multistep_form’, ‘callback’ => ‘ajax_multistep_form_ajax_callback’, ), ); } else { $form[‘buttons’][‘submit’] = array ( ‘#type’ => ‘submit’, ‘#value’ => t(‘Submit’), ‘#ajax’ => array ( ‘wrapper’ => ‘ajax_multistep_form’, ‘callback’ => ‘ajax_multistep_form_ajax_callback’, ), ); } return $form; }

  1. Add validation for your fieldsIt will add validation for phone number field in step 2. You can add validations for other steps too.

function ajax_multistep_form_validate($form, &$form_state) { switch($form_state[‘step’]) { case “2”: $contact_phone = $form_state[‘values’][‘phone’]; $contact_errror = ‘”‘.$contact_phone .'”‘ . ‘ is not a valid North American phone number. Please enter a valid ten-digit phone number with optional extension in this format 123 456 7891.’; if (!preg_match(‘/([0-9]{3}?\s?[0-9]{3}?\s?[0-9]{4})/’, $contact_phone)) { form_set_error(‘phone’, $contact_errror); } break; } }

  1. Final submit function

function ajax_multistep_form_submit($form, &$form_state) {   $step = $form_state[‘step’];   //$form_state[‘storage’][‘step_’ . $step] = $form_state[‘step’];   if($form_state[‘step’] == 1) { $form_state[‘storage’][‘step_’ . $step][‘fname’] = $form_state[‘values’][‘fname’]; $form_state[‘storage’][‘step_’ . $step][‘lname’] = $form_state[‘values’][‘lname’];   } if($form_state[‘step’] == 2) { $form_state[‘storage’][‘step_’ . $step][‘phone’] = $form_state[‘values’][‘phone’]; }   if(isset($form_state[‘values’][‘next’]) && $form_state[‘values’][‘op’] == $form_state[‘values’][‘next’]) { // Goto next step $form_state[‘step’]++; }   if(isset($form_state[‘values’][‘back’]) && $form_state[‘values’][‘op’] == $form_state[‘values’][‘back’]) { // Goto next step $form_state[‘step’]–; } // Check if it is last step elseif(isset($form_state[‘values’][‘submit’]) && $form_state[‘values’][‘op’] == $form_state[‘values’][‘submit’]) {   $form_state[‘storage’][‘step_’ . $step][‘street’] = $form_state[‘values’][‘street’]; $form_state[‘storage’][‘step_’ . $step][‘city’] = $form_state[‘values’][‘city’];   $items = array($form_state[‘storage’][‘step_1’][‘fname’], $form_state[‘storage’][‘step_1’][‘lname’], $form_state[‘storage’][‘step_2’][‘phone’], $form_state[‘storage’][‘step_3’][‘street’], $form_state[‘storage’][‘step_3’][‘city’]); drupal_set_message(t(‘You submitted the following values:!values’, array(‘!values’ => theme(‘item_list’, array(‘items’ => $items)))));   $form_state[‘step’] = 1; $form_state[‘storage’] = array(); } $form_state[‘rebuild’] = TRUE; }

  1. Ajax callback function for every buttons in our form

function ajax_multistep_form_ajax_callback($form, &$form_state) { return $form; }

This it just an example, you store all steps value in “$form_state[‘storage’]” and use it.

$step = $form_state[‘step’]; $form_state[‘storage’][‘step_’ . $step][‘values’] = $form_state[‘values’];

Hope this helped you to get most out of the system. Feel free to share your reviews or need assistance regarding our

CakePHP development services then get in touch with us. #WeDrupalEveryday. Pick the best answer for your requirements.

Everything You Need To Know About Drupal Mail System

Drupal Mail System

This blog is all about Drupal Mail system. Email sending in Drupal is entirely straightforward. Essentially you just need to manage two stages to send an email to somebody:

In Drupal to sends an email we need to take care of two things:

  • Declare all the required properties (subject, body, headers, etc) under hook_mail().
  • Call drupal_mail() with the argument for actually sending the email.

However, in the situation like greater and complex site, the above strides won’t be sufficient. In any case, Drupal gives us the Flexibility to redo email sending process, before that it’s important to know how stuff functions in the background first, with the help of Drupal you can easily generate custom pdf using the print module. In this blog, I’ll demonstrate to you how you can redo and extend the Drupal mail framework to satisfy your necessities.

The Email Sending Process

While sending an email drupal_mail() function uses system class for sending an email. Each mail framework needs to actualize MailSystemInterface class to define its own mail sending conduct.

MailsystemInterface class utilizes two strategies:

  • format()
  • mail()

The Mail System Module

Mail related settings can be set through Configuration > System > Mail System.

The mail system variable contains two things:

  • default-system => DefaultMailSystem
  • mailsystem_theme => current.

These key-value pairs are the settings you can adjust under the “Mail System Settings” fieldset.

DefaultMailSystem

The default-system email key describes which mail system class will be used by default for all outgoing emails.

If you don’t modify the site-wide mail system class then this one will be used by drupal_mail() by default.

The mailsystem_theme defines which theme will be used to render emails. Let’s say you are using Mime Mail which

uses a specific template file for it’s emails. The Mail System module checks every theme registry entry for a specific

“mail theme” key/property and if it exists in a particular entry then the specified mailsystem_theme value will be used

to search for more specific template files when the theme registry entry related theme hook will be called.

New Class

If you have two or more different mail system classes available in your system provided by different modules.

If you want to use any custom mail class which would use format() method of one mail system class and mail()

method from another class, so here you can use New Class which allows combining two different mail system classes.

New Setting

The Mail System module permits you to effortlessly add new email keys to the mail_system variable by choosing a

module and a particular email key from its hook_mail() execution.

 

Afterward added new email key to the mail_system variable you will ready to choose mail system class for it.

You will have the capacity to see it under all inclusive default MailSystemInterface class settings.

At the point when drupal_mail is called with your demo_custom _mail email key, then the in a roundabout way utilized

drupal_mail_system() function checks if this email_key exists in mail_system variable. It finds the related key then the

related mail system class will be utilized rather than default class.

Hope this helped you to get most out of the system. Feel free to share your reviews and need assistance regarding

Drupal Development Services. #WeDrupalEveryday

Pick the best answer for your requirements.