I have found the Vikas and he is amazing developer, he had always delivered the product under the timeline, on budget and with 100% accuracy, He is totally problem solving guys.
How To Overriding Drupal Views using Templates
0 comments |
- Create a view as per your requirement.
- Expand the Advanced section of your view and click on "Theme: Information" link.
- Multiple Naming options available for each field which you filtered. In general we are taking any name of "Field Content: Title (ID: title):". Copy any name of it probably last one like below image.
- Create a php file with name choosen from previous step. (In my case template file name will be "views-view-field--list-node-page-titles--page-1--title.tpl.php")
- Now click on Your field name like "Field Content: Title (ID: title):"
- You will find some commented text which contain the information about the theme template used for this row style, Copy that text.
- Add this commented text in your template file (In my case template file name will be "views-view-field--list-node-page-titles--page-1--title.tpl.php").
- Add this code on the above template file
<?php $node_obj = node_load($row->nid); print '<pre>'; print_r($node_obj); print '</pre>'; ?>
Note:-- node_load() is used for loading existing nodes when you have the ID (nid) of that node. $node_obj is a custom variable which I have taken.
- Now, First open /admin/config/development/performance and hit Clear all caches button and navigate your blog page in your browser, You will found an array with node fields value.
- Now arrange fields according to your requirement.
Add new comment