Skip to content

Instantly share code, notes, and snippets.

@bewildergeist
Created January 2, 2011 22:06
Show Gist options
  • Save bewildergeist/762865 to your computer and use it in GitHub Desktop.
Save bewildergeist/762865 to your computer and use it in GitHub Desktop.
How to export a Textpattern site as XML
<!--
How to export a Textpattern site as XML
---------------------------------------
I've used the following template to export a Textpattern
site as XML via the rah_external_output plugin.
This makes it easy to import it into another
CMS that can parse the XML, such as [Symphony][1].
The exact XML structure can of course easily be
adapted to any specific requirements.
[1]: http://symphony-cms.com/
-->
<!-- Textpattern template served as text/xml via this plugin: http://rahforum.biz/plugins/rah_external_output -->
<?xml version="1.0"?>
<sections>
<txp:section_list sections="about,services,references,contact" break="section" class="">
<txp:section title="1" wraptag="name" />
<txp:section wraptag="url" />
<articles>
<article class="sticky">
<txp:article_custom section='<txp:section />' status="sticky" limit="1">
<txp:output_form form="article_export" />
</txp:article_custom>
</article>
<txp:article_custom section='<txp:section />' limit="999" break="article">
<txp:output_form form="article_export" />
</txp:article_custom>
</articles>
</txp:section_list>
<txp:section_list sections="weblog" break="section" class="">
<txp:section title="1" wraptag="name" />
<txp:section wraptag="url" />
<txp:article_custom section='<txp:section />' limit="999" wraptag="articles" break="article">
<txp:output_form form="article_export" />
<txp:comments wraptag="comments" break="comment" class="" form="comments_export" />
</txp:article_custom>
</txp:section_list>
</sections>
<!-- Form: article_export -->
<title><txp:title no_widow="0" /></title>
<author><txp:author /></author>
<posted><txp:posted format="%Y-%m-%dT%H:%M:%S%z" /></posted>
<url><txp:article_url_title /></url>
<id><txp:article_id /></id>
<excerpt><![CDATA[<txp:excerpt />]]></excerpt>
<body><![CDATA[<txp:body />]]></body>
<!-- Form: comments_export -->
<author><txp:comment_name link="0" /></author>
<email><txp:comment_email /></email>
<url><txp:comment_web /></url>
<id><txp:comment_id /></id>
<posted><txp:comment_time format="%Y-%m-%dT%H:%M:%S%z" /></posted>
<body><![CDATA[<txp:comment_message />]]></body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment