I think I’ve come with a new way to import Textpattern entries into EE. It’s worked for me, and I wondered if anyone else fancied testing it? I’v tried a script that was mentioned on the wiki, but it generated errors when trying to create dates (which meant that all dates were 1970!). Also, I have several sections that need to be translated to separate weblogs in EE.
The approach is to use Textpattern’s templates system to output the entries in a movabletype format.
- Create a new section called ‘export’ and link it to a new page template called ‘export’. In that template add the following:
<txp:article_custom section="name-of-txp-section-here" form="export" limit="4" />
- Then create an article form called “export” with the following:
TITLE: <txp:title />
AUTHOR: <txp:author />
DATE: <txp:posted format="%m/%d/%G %I:%M:%S %p" />
PRIMARY CATEGORY: <txp:category1 />
CATEGORY: <txp:category2 />
<txp:php>echo "-----"."\n";</txp:php>
BODY:
<txp:body />
<txp:php>echo "-----"."\n";</txp:php>
<txp:if_excerpt>
EXCERPT:<txp:excerpt /></txp:if_excerpt>
<txp:php>echo "-----"."\n";</txp:php>
<txp:if_comments>
<txp:comments form="exportcomments" break="" />
</txp:if_comments>
<txp:php>echo "--------"."\n";</txp:php>
- Then create a comment form called ‘exportcomments’ with the following:
COMMENT:
AUTHOR: <txp:comment_name link="0" />
EMAIL: <txp:comment_email />
URL: <txp:comment_web />
DATE: <txp:posted format="%m/%d/%G %I:%M:%S %p" />
<txp:comment_message />
-----
- The visit yourdomain.com/export and view the source. Copy and paste this into a .txt file, and import into EE making sure to select formatting to none (the entries are already in HTML).
That seemed to do the trick for me, but if anyone else fancies a go on a test site to see if it does work, then great!
Edited to make the date output correctly
