Help - Search - Members - Calendar
Full Version: shifting data from one field to another
Movable Type Community Forum > Additional Resources > Tips and Tricks
bmk
Do you mean this documentation: Movable Type Import Format

Brenna
jedro
I want to shift some data from one field to another (eg move all my blog data that currently sits in excerpts into extra body text).
One way I thought of doing this would be to make a template similar to the export template, but have it so that the excerpt data is output into the extra body field - and then reimport the data. Could somebody please post the export template (I could work out what it is, but I want to make sure it's exact)?
Obviously there are better ways - parsing a standard export file, for example - but I don't have the knowledge. Any suggestions?
btrott
This is what the export template looks like (although it doesn't have the lastn="1000" in it, because it actually loops through each of the entries using the Perl API). But the following should work.

CODE
<MTEntries lastn="1000">
AUTHOR: <$MTEntryAuthor$>
TITLE: <$MTEntryTitle$>
PRIMARY CATEGORY: <$MTEntryCategory$>
<MTEntryCategories>
CATEGORY: <$MTCategoryLabel$>
</MTEntryCategories>
DATE: <$MTEntryDate format="%m/%d/%Y %I:%M:%S %p"$>
-----
BODY:
<$MTEntryBody convert_breaks="0"$>
-----
EXTENDED BODY:
<$MTEntryMore convert_breaks="0"$>
-----
EXCERPT:
<$MTEntryExcerpt no_generate="1" convert_breaks="0"$>
-----
<MTComments>
COMMENT:
AUTHOR: <$MTCommentAuthor$>
EMAIL: <$MTCommentEmail$>
IP: <$MTCommentIP$>
URL: <$MTCommentURL$>
DATE: <$MTCommentDate format="%m/%d/%Y %I:%M:%S %p"$>
<$MTCommentBody convert_breaks="0"$>
-----
</MTComments>
--------
</MTEntries>
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.