Drupal Technical
| 1
min read
Consider a case where you want to enter regular expression and validate it. Here I will show you how to write a validation function. For example consider YOURMODULE_admin_settings_validate function
In my example I am using a form and a submit button.From $form_state array you can get the input value after submit. You need this value to match with the string. See the code below.
Drupal Technical
| 3
min read
In this article I am going to tell you how to redirect anonymous users to a login form on 403 access denied pages in Drupal. There are some contributed module that provides you this feature but, if you really want to create a custom one for your site just try this. Here I will show you a PHP snippet that redirecting to login page for anonymous users on access denied.
Drupal Technical
| 1
min read
Sometimes we use Drupal view_query_alter to add or modify the view's where clause. To add a new WHERE clause we may use add_where property. Whenever we use an add_where, it will create a WHERE clause along with an AND condition. There will be some cases were we need to use OR instead of AND. So if you want to know more about how to use OR clause in hook_view_query_alter, read on to know more.
Drupal Technical
| 3
min read
When I was working on a website in Drupal 6 I wanted to theme the pager provided by views in a custom way. Finally I found a solution for the issue. If you also want to theme the pager in a View for your Drupal website you can follow the method below.
Drupal Technical
| 3
min read
Recently PayPal changed their policies and creating a sandbox account was a bit confusing for me, when I wanted to test my ubercart site. However, I created one and thought of writing about it in case some one needs it. So, here it goes.
Drupal Technical
| 4
min read
If you want to switch among contents or nodes in Drupal 7 website, you can do this by adding navigation links(PREV and NEXT) to that particular content. This will help you to see contents without going to any other link. There are contributed modules in Drupal for this but if you want to know how this can be created programmatically, read on.