[SOLVED]Frontend editing MEF layout override

  • jeffreyliu77
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 years 6 months ago - 11 years 6 months ago #1643 by jeffreyliu77
[SOLVED]Frontend editing MEF layout override was created by jeffreyliu77
i have K2 catalog which requires registered user input many MEF (product specs info group, price group, contact info group etc)
Almost everything of default input fields will be removed. Tabs such as image, image gallery, extra fields, even the default text editor will be removed.

Only use all info from many MEFs.

Which file shall I override or modify besides itemform.php?
Last edit: 11 years 6 months ago by jeffreyliu77. Reason: thanks for help!

Please Log in or Create an account to join the conversation.

  • jeffreyliu77
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 years 6 months ago #1644 by jeffreyliu77
Replied by jeffreyliu77 on topic Frontend editing MEF layout override
While checking around, found out that at frontend ADDING a NEW k2 item, MEF is not being displayed. Only the K2 default single extra field is shown up.

Please Log in or Create an account to join the conversation.

  • jeffreyliu77
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 years 6 months ago #1645 by jeffreyliu77
Replied by jeffreyliu77 on topic Frontend editing MEF layout override
frontend EDITING an item, MEF shows up perfectly, but any modification can't be saved.

Please Log in or Create an account to join the conversation.

More
11 years 6 months ago #1646 by mmmaug1977
Replied by mmmaug1977 on topic Frontend editing MEF layout override
Hi jeffrey,

Most probably there is a javascript error, can you find out whether there is a javascript error?

Please Log in or Create an account to join the conversation.

  • jeffreyliu77
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 years 6 months ago #1647 by jeffreyliu77
Replied by jeffreyliu77 on topic Frontend editing MEF layout override
Thanks for the reply.

Frontend EDITING save, now is working. But ADDING NEW k2 ITEM, still only display the default selected single fields group inside Category settings.

Anyway, I need study your code first, so that when the /default/itemform.php is opened at front end, all MEFs shall be displayed flatly for either editing or new data sets encoding , then, save back to table _k2_items: extra_fields and extra_fields_search.

Please Log in or Create an account to join the conversation.

More
11 years 6 months ago #1648 by mmmaug1977
Replied by mmmaug1977 on topic Frontend editing MEF layout override
Hi jeffrey,

In some cases the MEFG ajax call is completed before the core ajax call of K2, which is initiated on changing the category, therefore the results of core K2 ajax call overrides the results of MEFG ajax call.

If you are able to modify the code, just edit the mefgfork2.php file, find this line:
Code:
$K2("#catid").on("change",function(){
and replace it with this line:
Code:
$K2("#catid").unbind("change").on("change",function(){

Then save and test, let me know if this solved the problem.

Please Log in or Create an account to join the conversation.

  • jeffreyliu77
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 years 6 months ago #1649 by jeffreyliu77
Replied by jeffreyliu77 on topic Frontend editing MEF layout override
By update the code above, Frontend ADDING new items, also works.

Thanks.

Please Log in or Create an account to join the conversation.

More
11 years 6 months ago #1650 by mmmaug1977
Replied by mmmaug1977 on topic Frontend editing MEF layout override
You are welcome.

It will be great if you post a review about MEFG to this page:
extensions.joomla.org/extensions/extensi.../k2-extensions/23477

Please Log in or Create an account to join the conversation.

  • jeffreyliu77
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 years 6 months ago #1652 by jeffreyliu77
Replied by jeffreyliu77 on topic Frontend editing MEF layout override

Mohamed Abdelaziz wrote: Hi jeffrey,

In some cases the MEFG ajax call is completed before the core ajax call of K2, which is initiated on changing the category, therefore the results of core K2 ajax call overrides the results of MEFG ajax call.

If you are able to modify the code, just edit the mefgfork2.php file, find this line:

Code:
$K2("#catid").on("change",function(){
and replace it with this line:
Code:
$K2("#catid").unbind("change").on("change",function(){

Then save and test, let me know if this solved the problem.



After I removed all K2 related plugins which i had installed, with or without changing the code, it works. Hope it will not stop working in case i install any other extension. :P

Please Log in or Create an account to join the conversation.

More
11 years 6 months ago #1653 by mmmaug1977
Replied by mmmaug1977 on topic Frontend editing MEF layout override

jeffrey wrote:

Mohamed Abdelaziz wrote: Hi jeffrey,

In some cases the MEFG ajax call is completed before the core ajax call of K2, which is initiated on changing the category, therefore the results of core K2 ajax call overrides the results of MEFG ajax call.

If you are able to modify the code, just edit the mefgfork2.php file, find this line:

Code:
$K2("#catid").on("change",function(){
and replace it with this line:
Code:
$K2("#catid").unbind("change").on("change",function(){

Then save and test, let me know if this solved the problem.



After I removed all K2 related plugins which i had installed, with or without changing the code, it works. Hope it will not stop working in case i install any other extension. :P

It will work with the code change, because if you installed more extensions, this make K2 more slower, therefore MEFG completes its processing and returns its result before K2, then the results will be overwritten by K2 again.

As you can see, it is advantage for MEFG thta it is faster than K2 in this area ;)

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum