Jump to content

How to export blogs


sladedesign
 Share

Recommended Posts

@sladedesign

You mean the module BatchChildEditor? I don't have much experience with this module but you can enable the Export CSV mode under Mode Settings in the module configuration. There you can also configure the CSV export settings. Then you have to set where the editing tools are available and you can see them under the children tab of those pages. There you can export the children of the page as CSV.

Do you want to export your blog posts from ProcessWire as CSV to import them into a WordPress website? Or what is it you want to achieve?

Link to comment
Share on other sites

I am not sure, if this module works for exporting users as CSV.

You could write your own CSV export script, like also mentioned in the thread posted above:

Just write the code at the beginning of your template:

<?php
header('Content-Type: text/csv');
header('Content-Disposition: attachment; filename="blog-posts.csv"');

$items = $pages->find("template=blog-post");
echo "title,url" . PHP_EOL; // Add more fields here
foreach($items as $item) {
    echo "\"$item->title\",\"$item->url\"" . PHP_EOL; // Add more fields here
}

return $this->halt();

For users this script could look like this:

<?php
header('Content-Type: text/csv');
header('Content-Disposition: attachment; filename="users.csv"');

$items = $pages->find("template=user, include=all");
echo "name,url,email,password" . PHP_EOL;
foreach($items as $item) {
    echo "\"$item->name\",\"$item->url\",\"$item->email\",\"$item->pass\"" . PHP_EOL;
}

return $this->halt();

But the user password is stored encrypted, so I don't think that this would help you much.

Or don't switch to WordPress. ?

Regards, Andreas

Link to comment
Share on other sites

Thanks for the help and advice. I've manually cut and paste the users as there was only a few hundred.

Still confused about the process for exporting posts though so if you have any advice on that I'd be delighted.

Alas WP is my primary platform and pretty much embedded in my business for 8 years now.

Link to comment
Share on other sites

24 minutes ago, sladedesign said:

Still confused about the process for exporting posts though so if you have any advice on that I'd be delighted.

There's no "ready to use" export function in processwire, but you can easily create one like described in the posts of AndZyk.
But I think you have not understood how Processwire works ? a simple introduction can be found here https://processwire.com/docs/tutorials/hello-worlds/

The important thing is that you understand that the export must be programmed by you via php. The module "BatchChildEditor" simplifies the whole thing only a little.
In the module description there is also a simple example: https://processwire.com/modules/batch-child-editor/

But you need an understanding of how PW is structured (Everything is a page, every page has a template, every template has fields, every field has a certain type).

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...