I've searched high and low and played around for a couple of hours, but I can't seem to figure out if there's a way to format the output to Word. For example, I don't want a table format. I want to display the fields:
<strong>Title</strong><br>
Body
<a href="%link">Read the original.</a>
Is there an interface tool for this? Is there a way to hack it? If neither is possible, could I make a feature request.
Thanks for your thoughts and assistance!
Comments
Comment #1
steven jones commentedYou will need to override the templates for building the word file export. Have a look at the theming guide for how to override templates.
Comment #3
seanenroute commentedThe simplest way to do this is to grab all your fields in the View and set their display status to Exclude. Then bring all your fields into a single Global Text Field using tokens. That way you only have one column.
Alternatively if you want to bring a full page into the view use the "Content: Rendered Node" views field.
Bonus info! If you want to bring CSS into the Word doc (and you know you want to) you have to add a
<style>markup to the views-data-export-doc-header.tpl template between the<head>tags.ex.
Comment #4
kristofferrom@Seanenroute, great tip about the 'rendered...' field (which is now called 'Rendered Content' for future reference.
Could you also provide a tip to get the width of each node/field span maximum 1. a4 page in the Doc export?
Comment #5
seanenroute commented@kristofferrom, the current version of Window docs is basically a fancied up html page. So as long as you apply html coding (styles not css) to keep things in check you should be okay. Paragraphs and such should automatically word wrap for the page.
The online resource I found most useful was http://sebsauvage.net/wiki/doku.php?id=word_document_generation - this got me going in the right direction.
Their code for output in A4 format was:
Comment #6
kristofferrom@Seanenroute. Great thanks. Can I persuade you to tell me exactly where to add this code?
Comment #7
seanenroute commentedYou add it right to the doc template file itself. It can be found in the theme folder of the the views_data_export module. In the case of the doc file you are looking for "views-data-export-doc-header.tpl".
Make a copy of that file and add it to your theme templates folder. Add the style code and it'll override the original doc template.
Comment #8
delacosta456 commentedhi
nice thanks .. but look like default views class are stripped .. so i am a littleconfuse on how to control Th,Td etc of specific field specific field is