Showing posts with label Row style output. Show all posts
Showing posts with label Row style output. Show all posts

Tuesday, December 31, 2013

Apply row style template in Drupal 7

We can design or apply our own design to drupal views (row style) in Drupal 7.

*) Goto Views -> Block or Page view -> Advanced -> Other -> Theme: Information.
*) Create the template file in your custom theme folder. Possible template file name can be created from "Row style output" in Theme: Information.
*) If required, please apply "Rescan template files" button.
*) Once rescan done, your template will be shown as bold.
*) Then press "Row style output" link, copy the code and paste into your template file.
*) Then you can design or apply your own design.

For Example: 
Create views-view-fields--<view name>--<view machine name>.tpl.php in theme folder
And apply the following code

<div class="ownclass">
    <a href="<?php echo $fields['field_link']->content; ?>">
        <?php echo $fields['field_image']->content; ?>
    </a>
</div>