How to access private files without Authentication

For drupal 7, When we create a file field for private access. So we can’t access or download this file without authentication. If sometimes we need this, you can follow my below code: [sourcecode language=”bash”] $uri = [resource_file]; // get file url if ( file_exists($uri) ) { $fileName = end(explode(‘/’, $uri)); $newUrl = ‘public://[your-file-directory]/’ . […]

views aggregation settings to remove duplicate records

For drupal 7, for removing duplication row in views result i described step by step procedures in below.. You can apply GROUP BY or DISTINCT by enabling views aggregation settings to remove duplicate records. 1. Go and edit your view 2. In Advanced » OTHER section by enabling Use aggregation: Yes 3. In FIELDS or […]

How to load views by passing a argument in views programmatically

I will load views data in a module/theme function programmatically by passing taxonomy term id in a views argument by below views api.. [sourcecode language=”bash”] views_embed_view(‘contact’,’panel_pane_2′, $term_id); [/sourcecode] from in below views…

How to load field collection data programmatically in drupal 7

Always we have to face a hard works to get field collection data in views, node_load, etc. I am giving a example code in below for load field collection fields data in a entity. Here, entity is “Node”, Field collection field is “field_timeline” [sourcecode language=”bash”] $timelineData = entity_load(‘node’, array($node->nid) ); $node_data = $timelineData[ $node->nid ]; […]

How to develop a relationships between two/more content types by reverse node reference field of a field collection ( Part 2 )

For drupal 7 , i want to develop relation between content types by views Relationships . Suppose biography is content type and Fund is another content type. Field collection are in like below image… Here, biography node reference is presented in Fund content type. Like in below image… First of all, i will develop a […]

How to develop a relationships between two/more content types by reverse node reference field ( Part 1 )

For drupal 7 , i want to develop relation between content types by views Relationships . Suppose biography is content type and Fund is another content type. Here, biography node reference is presented in Fund content type. Like in below image… First of all, i will develop a views for biography. Like in below image… […]

How to create custom page by menu hook api

From title, you can easily guess i want to show you how to create a custom page by hook_menu api. I am described in below steps by steps. 1. Write below code in example.module [sourcecode language=”bash”] function example_menu() { $items = array(); $items[‘individual-investors/popup-display’] = array( ‘title’ => t(‘Investor Sign’), ‘description’ => t(‘Investor Sign’), ‘page callback’ […]

How to use PHP Code in "Provide default value" of Contextual filters

Sometimes, we need to use PHP Code for filter contents in drupal views. Now i will show how to take data from url and contents will filter by Taxonomy Terms. 1. First of all, i developed a views and added a “Term reference” field in Contextual Filter of this view. Like in below image 2. […]

How to use Drupal as a Framework ( Part 1 )

When you decided to use drupal for developing a large-scale web site, you never think drupal is a CMS. You should think drupal is a CMF. When you will use drupal core, contrib modules for developing a site, drupal will consider as CMS. When you will use drupal core, contrib modules and extend core modules […]