Skip to Content

Welcome!

This community is for professionals and enthusiasts of our products and services.
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

This question has been flagged
As a moderator, you can either validate or reject this answer.
Accept Reject

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.

Avatar
Discard

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Related Posts Replies Views Activity
0
May 24
109
1
Apr 24
87
0
Mar 25
44
1
Jan 24
131
1
Nov 23
71