dump all content in a Word document (or a text file)

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: dump all content in a Word document (or a text file)

Post by Wishbone »

OK... I have a procedure for you to dump all your content into a single page so you can copy and paste into Word.

Create a User Defined Tag called "content_dump". Put the following in it:

Code: Select all

global $gCms;
$cntnt = $gCms->getContentOperations();

foreach ($cntnt->GetAllContent() as $page) {
echo '<h1>' . $page->mName . '</h1>';
$page_data = $cntnt->LoadContentFromAlias($page->mAlias);
echo($page_data->mProperties->mPropertyValues['content_en']);
echo "<br><br>";
}
Create a page called "word".. Go to the options and turn off the menu so it doesn't change your menus. Put the following in this page.

Code: Select all

{content_dump}
here's my test: http://www.thefcff.com/?page=word

Now you can copy and paste it into a word document.

NOTE: This won't process any smarty you might have on a page. If you need news as well, that's another procedure.
Last edited by Wishbone on Wed Jan 27, 2010 9:42 pm, edited 1 time in total.
User avatar
Charles Butcher
Forum Members
Forum Members
Posts: 103
Joined: Sat Jul 05, 2008 8:25 pm

Re: dump all content in a Word document (or a text file)

Post by Charles Butcher »

Wishbone, that's really nice. But Sven, couldn't you persuade a translator to work directly in CMSMS? You would have to duplicate your Dutch pages and put them somewhere hidden, but it would save a lot of work re-importing the content. Just a thought!
User avatar
Charles Butcher
Forum Members
Forum Members
Posts: 103
Joined: Sat Jul 05, 2008 8:25 pm

Re: dump all content in a Word document (or a text file)

Post by Charles Butcher »

You would have to trust your translator, of course, and I know they use all kinds of Windows-based tools that probably tie into MS Word.

But I make a lot of my income from "polishing" translations, or material that's been written in English by non-native speakers, and I think it makes sense to reduce the number of times text is moved around.

One client asked me to edit all the copy on a website, which could have been a nightmare since there were hundreds of small files. But they gave me FTP access and I did it all in a text editor, editing one file at a time directly on the server, and it went very well.

If you added a style called "done", whose text was set to be hidden, maybe the translator could use this to "turn off" chunks of original text as soon as they'd been translated, yet without deleting anything.
Post Reply

Return to “The Lounge”