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. Michel
  2. Form2Content Lite & Pro
  3. Thursday, 26 February 2015
  4.  Subscribe via email
Hi,

I have installed F2C edit article plugin.

I have a menu item (with idemid) which opens an article generated by F2C.

This article shows the front-end "edit article" button generated by F2C edit article plugin.

When I click and open article form, I get following link
/index.php?option=com_form2content&task=form.display&view=form&layout=edit&return=aHR0cDovL3d3dy5ldXJvcXVhcnR6LmZyL3F1b3RhdGlvbnM=&id=558&Itemid=

That means current itemid is not affected ... so I all languages menus appear ... big mess

There is a routing issue. What can I do?

Regards
Michel
Accepted Answer
Accepted Answer Pending Moderation
Hi Michel and Patrick,

I have experimented with the plug-in and it's possible to add the Itemid.

I had to add some extra code to F2C. When F2C encounters an Itemid, it thinks this is coming from a Joomla menu link (like F2C Article Manager or Single Article menu items) and it starts searching for menu parameters.
In this case however, F2C is activated with a non-F2C menu item, and the original code got confused, because it could not find the expected parameters. I have written code in the F2C component to check if the menu item is an F2C menu item, before reading parameters.

The other code changes will take place in the F2C Edit Article plug-in.

With the Itemid there will be three options:

1) Do not append Itemid (the same as it is now)
2) Take the Itemid from the current displayed page
3) Calculate the Itemid based on user-defined rules

The last option is probably the most interesting one! A user can define rules to evaluate the Itemid. The parameters the rules can contain are language and ContentType.

Here's an example of the rules:

lang=en-GB;contenttype=47;itemid=435
lang=en-GB;itemid=484
lang=en;itemid=485
itemid=486

The evaluation will start at the first line. When a match is found, the evaluation is stopped and the itemid of that rule is used.

In this case, this will be the evaluation:

If the language = en-GB and the id of the Content Type is 47 then the itemid will be 435
If the language = en-GB then the itemid will be 484
If the language starts with en, the itemid will be 485 (this will match languages like en-GB, en-US, etc.)
If none of the above rules matched, then the itemid will be 486

The itemid's shall always be id's of non-F2C menu links!

Best,
Julien
Responses (13)
Accepted Answer Pending Moderation
Hi Michel,

I'll see if I can add the itemid too in the url.
Maybe optional by parameter? Because I don't know if it's always good to use the itemid for the editing screen.

best,
Julien
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 1
Accepted Answer Pending Moderation
Hi Julien,

Optional by parameter in plugin is not solution in a multilanguage site because itemid has to change in each language. The solution is to add to url the current itemid defined by the menu which links to the page showing edit button.

I will really appreciate a fast upgrade of the plugin.

Regards
Michel
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 2
Accepted Answer Pending Moderation
Hi Julien,

Solution would be a check box in plugin to allow or not allow addition of current itemid to url so that link can be used in the context of the menu or in modal window.

Thanks for your help.

Regards
Michel
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 3
Accepted Answer Pending Moderation
Hi Michel,

I don't think that the link can be used in a modal window.
Since F2C uses modal windows itself (image upload, user and template selection), you would get modal windows inside a modal window.
I think that will not work with Joomla.

best,
Julien
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 4
Accepted Answer Pending Moderation
Hi Julien,

Can you upgrade plugin to get itemid?

Regards
Michel
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 5
Accepted Answer Pending Moderation
Hi Michel,

I don't know yet.....

Technically it's not difficult to add the itemid. Just edit this file:

/plugins/content/f2ceditarticlebutton/f2ceditarticlebutton.php

Change line #53 that says:

$link = JRoute::_('index.php?option=com_form2content&task=form.edit&id='.$form->id.'&return='.base64_encode(JUri::getInstance()));

into these two lines:

$Jinput = JFactory::getApplication()->input;
$link = JRoute::_('index.php?option=com_form2content&task=form.edit&id='.$form->id.'&Itemid='.$Jinput->getInt('Itemid').'&return='.base64_encode(JUri::getInstance()));

But I can see that it has unwanted side effects in the component. It is probably not just a matter of adding it.....
That's something that has to be figured out first.

best,
Julien
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 6
Accepted Answer Pending Moderation
Hi Julien,

OK I will wait.

Regards
Michel
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 7
Accepted Answer Pending Moderation
Hi,

I too like to have an itemid but than to be able to associate a different template to the "form edit" view. This could be accomplished using a single parameter but I do understand the issue in multi language websites. Possibly an array of lang/itemid in the plugin settings?

Regards,
Patrick
Please read the F2C documentation before asking questions! Thank you if you've done so ;)
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 8
Accepted Answer Pending Moderation
Hi,

Possibly an array of lang/itemid in the plugin settings?
That would be great!

Regards
Michel
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 9
Accepted Answer Pending Moderation
Hi Julien,

It sounds good!
Do you release upgrade of F2C component and F2C edit article plugin?

Regards
Michel
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 10
Accepted Answer Pending Moderation
Hi Michel,

Yes, of course, but I have to test it first.

best,
Julien
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 11
Accepted Answer Pending Moderation
Please download the new version of the Edit Article Button plugin here:
http://www.form2content.com/download/f2c-plugins

Regards,
Patrick
Please read the F2C documentation before asking questions! Thank you if you've done so ;)
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 12
  • Page :
  • 1


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