ckSaveEditionPopup() definition

ckSaveEditionPopup() definition was created by Timfreak

Posted 6 years 1 month ago #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.

Replied by ced1870 on topic ckSaveEditionPopup() definition

Posted 6 years 1 month ago #47148
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

Joomlack Webmaster and Developer

by ced1870

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

Replied by Timfreak on topic ckSaveEditionPopup() definition

Posted 6 years 1 month ago #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:
Code:
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.

Replied by ced1870 on topic ckSaveEditionPopup() definition

Posted 6 years 1 month ago #47151
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

Joomlack Webmaster and Developer

by ced1870

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

Replied by Timfreak on topic ckSaveEditionPopup() definition

Posted 6 years 1 month ago #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:
Code:
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.

Replied by ced1870 on topic ckSaveEditionPopup() definition

Posted 6 years 1 month ago #47158
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

Joomlack Webmaster and Developer

by ced1870
The following user(s) said Thank You: Timfreak

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

Time to create page: 0.801 seconds

Fast and powerful creation, customizable and responsive.

Read More

We have 995 guests and no members online