I have a view data export that is accessible via an admin url /admin/commerce/orders/carts/export
I have tried replacing the template for the CSV as I need to make modification to it.
The view theme info does see the template file but when go to the URL it is not using it and instead uses the one in the module.
I have tried replacing it using theme_registry_alter but I had no luck.

Does any one know a magic trick to make it possible use custom template?

Comments

cotillardq created an issue.

akozoriz’s picture

You can use function hook_views_plugins_alter
Create own module, for ex. my_module and add such code to it

function my_module_views_plugins_alter(&$plugins) {
  $plugins['style']['views_data_export_csv']['theme path'] = drupal_get_path('module', 'my_module'). '/templates';
}

After that copy csv templates

<code>views-data-export-csv-body.tpl.php
views-data-export-csv-footer.tpl.php
views-data-export-csv-header.tpl.php

to templates folder in your module directory and change them as you wish.

abhijeet.kumar2107’s picture

Hi @akozoriz
I need to show only column and show individual filed value on horizontal row. How can i achieve this.

views_data_export.theme.inc already writen as cell how can we alter and change in this file in cutom module.
views-data-export-xls-body.tpl.php