The Pathauto module automatically generates URL/path aliases for various kinds of content (nodes, taxonomy terms, users) without requiring the user to manually specify the path alias. It is a brilliant module that helping the site builders to adjust their URL patterns as per their requirement. But now its little bit confusing for those who come…Continue Reading
Drupal
Get a node ID from the URL in Drupal
Getting a node ID from the URL in Drupal is very easy just use the following snippet. If you need to get the node object, then you can use the following code:
Check if a user has a role in Drupal 7
Checking if a user has a role in Drupal 7
Drush command to download and enable a module
Drush command to download AND enable a module
Create a user programmatically in Drupal 7
Create a user programmatically in Drupal 7
Drupal 7 – How to Modify a Views Query in a Custom Module
To modify or alter a drupal view query, follow the below steps. Views are brilliant piece of functionality that can be added to drupal via a module. Step 1 Navigate to sites/all/modules/yourmodule and create your module.info file, to inform our module is ready to install on the system. yourmodule.info Step 2 Declare hook_views_api, as this…Continue Reading
18 Awesome sports websites powered by Drupal
Websites Powered by Drupal. Drupal content management is capable of building large scale websites of the modern world. In this post, I’ve mentioned some of the top Drupal websites specially made for Sports category including the 2016 Rio Olympics website by NBC. So here you go the list of websites that powered by Drupal. NBC Olympics NBC…Continue Reading
Adding to cart shows “there are no products in your shopping cart” unless a logged in uesr
Products are not adding to cart after we migrated the drupal 7, unless if you are not logged in user. So after spending some time in reasearch I got this solved. Problem – Unless you are not a logged in to user the products are not adding to cart Possible solutions Try checking your “users”…Continue Reading
What are some high traffic websites built with Drupal?
Most of them would be curious about what drupal can do in the enterprise world or as a social network website. As part of my Drupal tutorial I am listing out some of the high traffic websites built in Drupal. Linux Journal: http://www.linuxjournal.com/ Grammys http://www.grammys.com Ubuntu: http://www.ubuntu.com/ Drupal website itself: http://drupal.org/ CNN Go: http://www.cnngo.com/ Slate…Continue Reading
Remvoe the remove/upload button from the managed_file field in drupal form API
When you are working with Drupal form API or in module development, most probably you met this problem to add a maanged file field(uplaoding a file via ajax inside the form API). Here I am showing how to hide/remove a upload/remove button from managed_file uplaod field. May be its seems a bit crazy, but my…Continue Reading
Creating a module in Drupal 7
Drupal is an open source content management platform powering millions of websites and applications. It’s built, used, and supported by an active and diverse community of people around the world.-Drupal.org Modules are a set of functions and hooks(read more about hooks here). As part of module development in Drupal, we have to write functions to…Continue Reading
Hide PDOException errors are displayed in drupal screen
Question I need to hide PDOException errors are displayed in drupal screen, sometimes its happening if some problem with database server its showing some error with path to my folder I had solved this situation by using below code, added this code in settings.php
How to get the path to an image with ImageCache preset
Get the path to an image with ImageCache preset in Drupal 7, its very easy Use this function image_style_url($style_name, $path) See Example
How to get the aliased path from a node ID in drupal
If you want to use the aliased path of a node , in drupal. You can use this one drupal_lookup_path Example. Url http://mysite.com/node/20 OR Function drupal_lookup_path($action, $path = ”, $path_language = NULL) Parameters $action: One of the following values: wipe: delete the alias cache. alias: return an alias for a given Drupal system path (if one exists)….Continue Reading
Check if user is logged in Drupal 7
Here is a way to find the user logged or not in in custom Drupal Development. It is very usual you will face this question while developing a drupal website. You can use the following snippet to perform that
Drupal SEO Modules
Drupal SEO is pretty good out of the box. Adding things more to your site will be an advantage to more readable for search engines. Moreover, you should know about some SEO modules, custom Drupal Development to enhance your site. Here we are listing some modules pathauto The Pathauto module automatically creates URL/path aliases(human-friendly URLs)…Continue Reading
Create custom content type from module – Drupal 7
Create a custom content type with a module in drupal, it’s very easy for even a newbie. Modules are an essential part of a drupal website. There will be plenty of modules when comes to custom drupal development. So here I am showing how to create a custom content type programmatically in Drupal7. Just follow…Continue Reading