Please note that Form2Content is no longer being developed. All files from the latest version can be found on Github.

Form2Content Forum

Questions and answers for Form2Content, a Joomla CCK.
  1. Paul Zero
  2. F2C XML import/export
  3. Wednesday, 04 December 2019
  4.  Subscribe via email
Hi Lads !

Thanks for previous help with F2C article 'Export'.

For the record, all went well until I had a couple of import fails. It took me a while to figure out the problem - it was the encoding "UTF-8" - XML decoder spat the dummy during import!

The editor I use in Joomla (JCE) is setup to force "UTF-8" but it let through some curly inverted comma's, which came it to the offending article via a 'Cut & Paste'. After removing those curly inverted commas, re-saving, re-exporting, article imported OK.

As a result i'm now using 'Notepad++' in MS Windows with 'Encoding' set to 'UTF-8' to force encoding during article prep, saving, closing, then reopening, then cutting & pasting result into F2C. Long winded, but clean.

The Challenge:

Ok, As we all know F2C is the best tool ever for Joomla AND I know you guy's like a challenge !! So here's a good one for you to chew on:

I need to select articles for export from the front end.

I plan to use 'ChronoConnectivity' to pull articles from DB into a form. In preparation for this exercise I have added a new column to '_f2c_form' called 'exported' with default value of '0'.

Next I will use SQL to populate the 'ChronoConnectivity' form with SQL something like this:

$ database = JFactory::getDBO();
$ database-> setQuery("SELECT title,ID FROM #_f2c_form WHERE CreatedDate >= DATEADD(day,-2, GETDATE()) AND exported = 0";);
$ exportablearticles = $database->loadResult();

OK - If SQL is correct I will have a list of exportable articles created in the last 2 days. Next, I need to access the function 'public function export($cid)' in '/administrator/components/com_form2content/models/form.php' to process the export.

'/administrator/components/com_form2content/models/form.php'* calls:


* Doesn't seem to reference any other functions - looks self-contained to me.

In 'public function export($cid)' is 'foreach($cid as $id)'. I am assuming here that '$cid' is an array created by the form from listings selected by check box which contains title, ID etc. of each article selected for export.

So, not sure which is the best approach from here on: I could copy all of '/administrator/components/com_form2content/models/form.php' into a 'ChronoConnect' 'Action', and execute 'public function export' there ... OR .... what would you advise?

All help and guidance much appreciated - Happy Xmas to all,

Cheers PaulZero
Responses (2)
Accepted Answer Pending Moderation
  1. more than a month ago
  2. F2C XML import/export
  3. # 1
Accepted Answer Pending Moderation
Hi Paul,

This is a difficult one, since this hasn't done before I guess.
Copying all the files sounds like a last resort, it's a lot of work and if something changes you have to modify all files.

Trying to include the file to call the export sounds like a good solution.
You could also try to make a post request to the admin page that makes the export and mimic the actions a user makes, in the post data, when selecting files for an export request.

  1. more than a month ago
  2. F2C XML import/export
  3. # 2
  • Page :
  • 1

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