Blogs on

Drupal planet

knackforge blog

How to make Apache solr search programmatically from Drupal 7

Recently I came across a situation where I needed to make Apache solr search from drupal programmatically. Basically we have Apache solr module available in drupal, which enables to connect with solr for searching. There are loads of documentation for setting solr search with drupal, so instead going into those details, lets head straight to the custom code required to make programmatic solr search from drupal:

Continue reading →
knackforge blog

Review of Drupal professional themes

DropThemes.in is one among the best Drupal professional theme selling sites. With decades of free theme and quality of paid themes, DropThemes.in has got its own place in the list professional theme selling sites. All our themes are Responsive and catered specifically for Drupal sites. A good theme gives your website a distinct feel that sends out a positive impression to your visitors. In this post, we would like to review the top themes on DropThemes.in to help you select the best.

Continue reading →
knackforge blog

Create single page site in drupal 8 within 15 minutes

We all know that the Drupal setup and installation are easy, and one click installation is also available in most of the hosting services, but the tricky part is theming the drupal site. It would take some time to design the site to make it look more professional.

In this blog, I am going to show you how to build a single page drupal site within 15 minutes with a good looking theme.

Continue reading →
knackforge blog

How to delete an order if the order is in cart for N days

In drupal commerce, the order will be created when a product is added to cart and the order will exist until the order is deleted or order status is changed to completed.

We have an e-commerce site in which most of the orders are idle in the shopping cart. So we decided to delete the order if the order is in the shopping cart for more than 'N' days or weeks. I have written a custom drush command for deleting the order.

The following code is used to delete an order if it is in the cart for more than 25 days.
 

Continue reading →
knackforge blog

Programmatically create and trigger feeds importer

We met with a challenging requirement where we needed to create a feeds importer on node creation of particular content type. It’s like for ‘n’ number of nodes there must be a ‘n’ number of feeds importer.

For that I created a feeds importer which will be considered as the template. Whenever the node of specific content type is created, the template will be cloned and a new importer will be created.

The following code needs to reside in hook_node_insert() and will be used to clone the feeds importer:

Continue reading →
knackforge blog

CDN Module, and Amazon Cloudfront in Drupal 7

Recently I decided to check out Amazon CloudFront to use it as a CDN. I felt delighted as it was so easy to setup with drupal and configuring it involving just a few steps. Another thing that excited me was its cost. It is really really cheap, just costs about 12 cents per gigabyte of transfer.

Step 1: Create a CloudFront Web Distribution

     To create a CloudFront web distribution

Continue reading →
knackforge blog

Drupal moodle integration

We got an interesting requirement, to integrate Drupal and Moodle (Totara actually) in order for a nice combination of CMS features and LMS features. The integration should follow SSO, where a user logged in Drupal should automatically be logged in Moodle.

We decided to use existing plugins as much as possible along with additional customization wherever needed.

Continue reading →
knackforge blog

Disable Drupal 8 cache during development

We know Drupal 8 has a heavy caching mechanism, so we need to clear cache for changes made in twig file or some other file to reflect in the site. Basically, a themer or developer won't love the caching system on the development stage. So it is better to disable cache on the development stage rather than clearing cache for every change being made.

And here are the steps to disable cache and save your valuable time:

  • Copy and rename the sites/example.settings.local.php file as sites/default/settings.local.php

Continue reading →