Closed (fixed)
Project:
Views data export
Version:
7.x-3.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
4 Apr 2012 at 08:52 UTC
Updated:
3 Sep 2016 at 16:53 UTC
Jump to comment: Most recent
Comments
Comment #1
mdlopresti commentedI was having a similar issue that I just got thru. Maybe I can help,
What format are you using? and What's your use case?
If you don't mind me asking.
Comment #2
soulston commentedI'm trying to remove £ symbols as they are not required in the data but overriding the tpl files seems to have no effect on any figures.
Comment #3
steven jones commentedWhich template files specifically aren't working?
Comment #4
grimreaperHello,
If your export is for a view in the BO, when clicking the link to download, it's your BO theme that will be used. So if your template is overriding the default one is in your front theme, it will not be used.
So to be sure your template will be used. You can implement an hook_theme_registry_alter to force the use of your template, that can be anywhere, in a custom module by example.
Comment #5
andrewmacpherson commentedThe original post isn't clear whether it's about customizing the output using PHP generally, or using template files specifically.
It's possible to use Views API hooks to modify the output. Here's an example of
hook_views_pre_render()which worked for me in a custom module. My use case was to prepare a CSV export summarising all node content, for auditing purposes as part of a content strategy review. I wanted to add a word-count, so I set the view up to include the node body field, and replaced it with a word-count like so...hook_views_pre_render() would also be an appropriate way to tackle the use-case soulston mentioned, about removing £-signs.
Comment #6
turbogeek commentedThanks @andrewmacpherson, I was implementing a
hook_views_post_execute()and my exported data alterations were ignored. I guess that hook is called too soon. Implementinghook_views_pre_render(), which is called later, worked - thanks again :)Comment #7
jkingsnorth commentedSounds like this issue was fixed. Please do open a new support request if required.
Comment #8
jedihe commentedUsing hook_views_pre_render as explained in #5 worked for me too. Thx @andrewmacpherson!
Caveat: I had to clear all caches for Views to notice the pre_render hook.