Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: ckSaveEditionPopup() definition

ckSaveEditionPopup() definition 21 Feb 2018 11:05 #47147

Hi there,

I am developing a pagebuilderck plugin at the moment. This plugin will be very similar to the pagebuilder Testimonials plugin, but will have a different output on the page.

Therefor I am trying to reverse engineer the Testimonials plugin, but I am stuck on saving.

I found a function called ckSaveEditionPopup() in layouts/edit_testimonials.php, but I can't see this function is defined anywhere.

tl;dr; I don't know how to save after I made my edits. If I try to use that function it just simply doesn't work

Any help appreciated, thanks in advance!

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

ckSaveEditionPopup() definition 21 Feb 2018 11:35 #47148

  • ced1870
  • ced1870's Avatar
  • Offline
  • Administrateur
  • Administrateur
  • Posts: 21167
  • Karma: 427
  • Thank you received: 2680
Hi

I am developing a pagebuilderck plugin at the moment.

wow! great news :)

will have a different output on the page

do you know that you can also do some template override ?

you don't have to use ckSaveEditionPopup() , I have to remove it here. I have not seen that it was still there

The system will automatically call the ckSaveEdition() function which throws ckBeforeSaveEditionPopup() before doing anything.
You will find this function ckBeforeSaveEditionPopup() in the layout of the testimonials plugin. So here you can do what you need before it saves, then the save function will do the job.

In summary :
- you don't need to do anything, it will save.
- use the ckBeforeSaveEditionPopup() function if you need to update any data before saving

What you shall understand is that the save method will save the options from the fields in the left panel. But it will not manage the edition of the content (where you fill the title, content, image, etc for each slide).

Check the ckUpdatePreviewArea() which is called before save and which manage the html code to update the content. This is probably what you are looking for

Let me know
CEd

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

Joomlack Webmaster and Developer

ckSaveEditionPopup() definition 21 Feb 2018 13:13 #47150

Thanks for the quick reply!

do you know that you can also do some template override ?

yes, I know about template overrides, but in this case it would be ideal to have a different plugin for this because it'll have slightly different fields aswell. This will be a "Team modul" to display for example company members or any other team members really.

quick recap of what I did:
I tried copying the whole plugin which probably didn't work out that well due to naming. Even after changing the naming from testimonal to team through search and replace the module didn't show up or broke the entire pagebuilder.

So I decide to write my own module with the documentation at hand.

I got this far:
1. The plugin shows up
2. I can drag it into the editor
3. the preview is shown in the editor
4. I can edit the modul and the popup opens
5. now the problem:
as soon as I click on the checkmark and save the edits I made and reopen the edit popup my changes are gone.

for the layout/edit_team.php i copied the layout/edit_testimonials.php
can there be a scope problem somewhere?
I also don't get any errors in the console.

- use the ckBeforeSaveEditionPopup() function if you need to update any data before saving

at the moment the ckBeforeSaveEditionPopup() function just consists of the following:
function ckBeforeSaveEditionPopup() {
	var focus = $ck('.editfocus');

	ckUpdatePreviewArea();
	ckSaveEditionPopup(focus.attr('id'));
	ckCloseEditionPopup();
}

Has the ckUpdatePreviewArea(); anything to do with the saving?
But then again it is literaly the edit_testimonial.php file which should handle all that correctly. I think there might be a naming or scope issue here.

summary:
- I can definitely not just copy the whole edit_testimonials.php file or I am missing something.

Sorry for bothering, and again appreciate the quick help!

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

ckSaveEditionPopup() definition 21 Feb 2018 13:33 #47151

  • ced1870
  • ced1870's Avatar
  • Offline
  • Administrateur
  • Administrateur
  • Posts: 21167
  • Karma: 427
  • Thank you received: 2680
your way to do is good. You shall be able to copy and rename the plugin. This works (if made correctly ;) )
then your function ckBeforeSaveEditionPopup() is ok, you can just remove : (useless now)
ckSaveEditionPopup(focus.attr('id'));
ckCloseEditionPopup();

then try again and tell me. if this does not work, then give me a copy of your plugin

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

Joomlack Webmaster and Developer

ckSaveEditionPopup() definition 22 Feb 2018 07:46 #47157

Alright I tried to copy the plugin a second time and I think I am doing something wrong here.
Now when trying to convert an article to a pagebuilderck article I get the following error:
0 syntax error, unexpected 'defined' (T_STRING)

This is the plugin I have at the moment: www.dropbox.com/s/3zpxa7f9dafcsvy/teams.zip?dl=0

Also when this project is done we'd be happy to contribute this to the default list of pagebuilder plugins

Thanks in advance ^^

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

ckSaveEditionPopup() definition 22 Feb 2018 07:56 #47158

  • ced1870
  • ced1870's Avatar
  • Offline
  • Administrateur
  • Administrateur
  • Posts: 21167
  • Karma: 427
  • Thank you received: 2680
right, your copy is not correct. Make a search in all files of the plugin, you will find many "testimonials" terms wher it shall be "teams"
also the language files are called "team" instead of "teams"

Then I tried to install it : ok (except the language)
I can use a page and article and add the teams item and edit it

Of course I could do it, but as you seems motivated to do it yourself, I continue to give you my help here.
If you want that I give you a fresh copy of a "teams" plugin that you can then modify, let me know
The following user(s) said Thank You: Timfreak

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

Joomlack Webmaster and Developer

ckSaveEditionPopup() definition 23 Feb 2018 08:40 #47164

alright, I have a half functioning module now. I am stuck on editing and saving now (or rather again).

I changed the content of onPagebuilderckLoadItemContentTeams() to my layout which works fine. Obviously the edit doesn't work anymore because the content is different now.
But I can't find the function where the content is updated or the edit is created.

I found the ckUpdatePreviewArea() function but that updates the edit window as far as I know?

summery:
- I don't know how I can update my content
- I don't know how to create the edit items from my content

My current plugin: www.dropbox.com/s/3zpxa7f9dafcsvy/teams.zip?dl=0

Thanks in advance!

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

ckSaveEditionPopup() definition 23 Feb 2018 10:27 #47166

  • ced1870
  • ced1870's Avatar
  • Offline
  • Administrateur
  • Administrateur
  • Posts: 21167
  • Karma: 427
  • Thank you received: 2680
ok, it seems that you have changed many names in the plugin without keeping the logic
Just replace "testimonial" by "team" would be great and keep the logic in the css classes

"ckUpdatePreviewArea() function but that updates the edit window as far as I know"
>> yes this is where you have to play to keep the infos from the edition and push them into the content. This is only managed by Javascript.
"ckLoadEditionPopup()" is also called in the other way, to get the content and fill the edition with it

Here you are starting with one of the most complex plugins (don't try to create a table plugin ! :D), so you are not aware with the Javascript, it will be a real problem.
Your code must stick to your html code that is rendered into the content, this is how you can play with all elements and values.

PS : just removed
ckSaveEditionPopup(focus.attr('id'));
ckCloseEditionPopup();
and the behavior is already better, like explained before ;)

Now, what we can do :
1/ you have the skill and you decide to develop it until the end, even if you have to stop your life and reduce your sleeping time ;)
2/ I can give you the plugin based on the frontend layout that you show me, then I will integrate it in the next version of hte Params and keep it up to date

like you want :)

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

Joomlack Webmaster and Developer

ckSaveEditionPopup() definition 23 Feb 2018 10:55 #47167

ok, it seems that you have changed many names in the plugin without keeping the logic
Just replace "testimonial" by "team" would be great and keep the logic in the css classes

yes I replaced every "testimonial" with "team" through the entire project. (which also effected all css classes)

Anyway to be honset at this point I prefer option 2. I'd really like to experiment further and really understand the logic but we were initially trying to get this project done by the start of next week and it will most likely be faster if you do the implementation of the current layout.

I will attach a javascript file important for the frontend (nothing huge)

Thanks for this amazing help! Really fast and great support ^^
Attachments:

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

ckSaveEditionPopup() definition 23 Feb 2018 12:08 #47168

  • ced1870
  • ced1870's Avatar
  • Offline
  • Administrateur
  • Administrateur
  • Posts: 21167
  • Karma: 427
  • Thank you received: 2680
this javascript is not useful at all. I will use the html/css layout that you have put in your plugin

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

Joomlack Webmaster and Developer
  • Page:
  • 1
  • 2
Time to create page: 0.217 seconds

Fast and powerful creation, customizable and responsive.

Read More

Qui est en ligne

We have 281 guests and one member online