Please read and follow the COMMON ISSUES first!
Always add your version information in every new post! Thank you!

Form2Content Forum

Questions and answers for Form2Content, a Joomla CCK.
  1. Paul Zero
  2. F2C XML import/export
  3. Sunday, 10 November 2019
  4.  Subscribe via email
Hi All !

I'm trying article import / export between websites running identical copies of F2C Pro.

I need to have all articles exported as 'unpublished'. As per your documentation I've had a look at:


Within that file I see:

<element name="state">

The state of the F2C Article.
The following values are accepted:
0 - unpublished 1 - published -2 - deleted

<restriction base="string">
<enumeration value="deleted"></enumeration>
<enumeration value="trashed"></enumeration>
<enumeration value="unpublished"></enumeration>
<enumeration value="published"></enumeration>

In a test output file '20191110065045 F2C Export.xml' I get '<state>published</state>'

I need '<state>unpublished</state>' so imported articles can be checked before articles are released on target website - Any ideas on how to achieve that ?

Cheers - Paulzero.
Responses (6)
Accepted Answer Pending Moderation
Hi Paulzero,

When you export the articles, the state will be the state that the articles have at that moment.
If you want to make sure that your articles are unpublished after an import, you have to edit the XML file before you import it.

This can be a simple find/replace action, or a more sophisticated XML modifying script.

Accepted Answer Pending Moderation
Hi Julien,

Thanks for feedback - bummer - had hoped for automatic 'unpubished' <state> option !

just a couple of other quick Q's:

- On 'Import' - if there are multiple .XML files in 'Import' directory, will they all be processed when accessing 'index.php option=com_form2content&task=articleimportcron' ?

- Does XML export / import do any character stripping ? I have embedded php code in some article bodies so must be sure nothing changes the articles content.

- Templates - Are templates combined with article when exported from source site - OR - does the imported article look for correct template on target site?

- XML File name - Can the auto created file name be changed (Eg: If I go in and do a 'find/replace' can I change the file name to something like ''20191110065045 F2C Export unpublished.xml')?

Cheers - Paulzero
Accepted Answer Pending Moderation
Hi Paulzero,

Yes, all files in the import directory will be processed. In fact it is better to have multiple small files than one large file that might cause a time-out.
When a time-out occurs, the system can easily pick up where it stopped when there are small files that can be handled quickly.

XML export does not strip any characters.

When you export a Content Type, it will include the template. This template will be written on the target site when the Content Type is imported. After the import, you can change the template, or replace it with another one.
The XML Article Import just uses a template with the name as specified in the import file.

Generated XML file names can be changed as you like....

I hope this helps!

Accepted Answer Pending Moderation
Hi Julien - thanks mate, you're a star !

Article Import / export all good,

Just one more small thing .......

I've linked cron call 'index.php?option=com_form2content&task=articleimportcron' to a menu item, when clicked, article imports OK - but - site displays a blank white page with no messages.

I know this is going to freak-out the users ! Looks like classic 'White screen of death' !

So - can you please point me to the location of 'articleimportcron' so I can add some text to it like 'All articles successfully imported ' and a button like 'Click to return to main index' etc.

Cheers - Paulzero
Accepted Answer Pending Moderation
Hi Paul,

I understand why you attached the import function to a menu item.
Our intention was that the import is an automated job that the user never sees.
But yes, it should be possible to add some text to this page.

The import function is executed in <your website>/components/com_form2content/controller.php
In the function ArticleImportCron you can add some output just before the line:

Accepted Answer Pending Moderation
Hi Julien
Thanks for info on adding words - am now running cron in modal, have added button at end to close modal - all good, thanks.

Regards - Paulzero.
  • Page :
  • 1

There are no replies made for this post yet.
However, you are not allowed to reply to this post.