This Bolt Extension is an Import filter for WXR / XML files, as created by Wordpress or PivotX.
How to use this extension, in a few simple steps:
.wxr file
, and place it in the folder app/config/extensions/importwxr
.app/config/extensions/importwxr.bolt.yml
, or using the 'Configure Extensions'
option in the backend of Bolt.Note: After importing, scroll down to check if the script completed. If
categories were found in the .wxr
-file, the script will tell you which should
be added to your taxonomy.yml
-file.
If you're importing a .wxr
file that was generated by a recent version of
Wordpress, the 'mapping' as defined in the importwxr.bolt.yml
configuration
should be good as-is. You might need to make a few modifications to your
contenttypes.yml
, to make sure all fields are present. See the example below,
for a working example.
If you already have set up your own contenttypes, just make sure of the following:
teaser
and body
need to be present in your pages
and
entries
contenttypes.taxonomy
is present, otherwise the extension will not import
your existing categories and tags.attachments
contenttype, if you want to import the attachments from
Wordpress.Note: Subsequent runs of the extension will keep importing the found
posts/entries again and again. If you're working on a fresh Bolt database, it's
probably good to set post_id: id
in the mapping configuration. This will make
the importer use the original ID from the import file, and it will overwrite
them, preventing duplicates in the Bolt database.
Example of contenttypes.yml, if importing from Wordpress:
pages:
name: Pages
singular_name: Page
fields:
title:
type: text
class: large
group: content
slug:
type: slug
uses: title
image:
type: image
teaser:
type: html
height: 150px
body:
type: html
height: 300px
template:
type: templateselect
filter: '*.twig'
taxonomy: [ categories, chapters ]
recordsperpage: 100
entries:
name: Entries
singular_name: Entry
fields:
title:
type: text
class: large
group: content
slug:
type: slug
uses: title
teaser:
type: html
height: 150px
body:
type: html
height: 300px
image:
type: image
group: media
video:
type: video
taxonomy: [ categories, tags ]
recordsperpage: 10
attachments:
name: Attachments
singular_name: Attachment
fields:
title:
type: text
class: large
slug:
type: slug
uses: title
image:
type: image
body:
type: html
height: 300px
url:
type: text
variant: inline