ckSaveEditionPopup() definition
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!
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!
by Timfreak
Please Log in or Create an account to join the conversation.
Hi
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
wow! great newsI am developing a pagebuilderck plugin at the moment.
do you know that you can also do some template override ?will have a different output on the page
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.
Thanks for the quick reply!
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.
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!
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.do you know that you can also do some template override ?
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.
at the moment the ckBeforeSaveEditionPopup() function just consists of the following:- use the ckBeforeSaveEditionPopup() function if you need to update any data before saving
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!
by Timfreak
Please Log in or Create an account to join the conversation.
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
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.
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:
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 ^^
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 ^^
by Timfreak
Please Log in or Create an account to join the conversation.
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
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