Default for sp page's accordion, it only support text and icon for the accordion
How if we want to customize it by adding button or something else to it?
We go ftp and find below location
components -> com_sppagebuilder -> addons -> accordion
admin.php = backend view
site.php = frontend view
What we need to do is add code on admin.php to allow admin to add button, then display the retrieve the button in site.php
admin.php
================================================
In code, you will see there got title, icon and content, which is same with:
So, if we want add button on it, can direct copy one of it and rename it
Now, we have adding two element on it, which is button and button url, then save the file, u will see the two element display out in the backend
Now, we already add new element for the accordion.
How get it in frontend?
site.php
================================================
When u add new element in backend, the $item on frontend will auto added object for it, like below:
So, u just need direct get the button text or button url with method
$item->button_text OR $item->button_url
After getting it, you can start your customization, such as deciding where to place the button or what URL to use for it.
Summary:
If you want to customize other SP Page Builder add on, it is also possible. You can find them in components -> com_sppagebuilder -> addons, and the logic is similar to what we just discussed.