The All Export Pro plugin can export RFG contents in a CSV file. I'm not sure how to combine the RFG and the parent post exports in a single file, but I can show you how to export the RFGs separate from the parent posts. If you want to import these RFG posts into another site, Toolset's relationships import process expects a column in the CSV file using the column header format _toolset_associations_rfg-slug: https://toolset.com/course-lesson/importing-content-from-csv-with-post-relationships/ Replace rfg-slug with the slug of your RFG. In my example, the RFG slug is book-rfg-1. The importer process expects the parent post's GUID (preferred) or post title in this column. You can use a custom function to export that value, with our post relationships API.
You mentioned you would like the related post's URL, so I can show you functions to access the GUID or the permalink of the parent post. You can add either column, or both columns, depending on your needs.
To get the related post GUID or permalink, you need to use a custom function in the All Export Pro configurations. Here is a custom function example that will help export the parent post's GUID information:
<?php
function rfg_parent_guid($id)
{
$parent_id = toolset_get_related_post( $id, 'book-rfg-1', 'parent');
$guid = get_the_guid($parent_id);
return $guid;
}
?>
Replace book-rfg-1 with the slug of your RFG.
If you want to include the parent post's URL (permalink), a function to export that information would look like this:
<?php
function rfg_parent_permalink($id)
{
$parent_id = toolset_get_related_post( $id, 'book-rfg-1', 'parent');
$permalink = get_permalink($parent_id);
return $permalink;
}
?>
Replace book-rfg-1 with the slug of your RFG.
I'm showing some screenshots of how you can set up a CSV export with a custom column including a value from a custom function in All Export Pro, and the results of this export in a CSV file.
1. Select the RFG as the specific post type
2. Include the post ID, title, content, and any custom fields you want to export from the RFG. I have included two custom fields, book-rfg-1-single-line-1 and book-rfg-1-single-line-2, and also included the field toolset-post-sortorder to preserve the sort order of the RFGs in each post. Next you need to add a custom field to include related post information.
3. Add a new custom field to the export. Use the column header format _toolset_associations_rfg-slug if you want to import these RFGs into another site along with their parent posts, or use any other format you want if you do not plan to import these RFGs into another site. Your new field should export the value returned by a custom function as shown here.
4. You can see the export configurations after adding the _toolset_associations_rfg-slug column/field.
5. Example CSV export results including the parent post's GUID information.