跳至内容

欢迎!

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.

此问题已终结
作为版主,您可以批准或拒绝该答案。
接受 拒绝

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.

形象
丢弃

您的回复

请大家尽量给个实质性的回答。如果您想回答这个问题或发表评论,只需 使用评论工具。请记住,您可以随时修改您的答案。 - 不用重复回答同样的问题。另外,请不要忘记投票 - 它确实有助于选择最好的问题和答案!

相关帖文 回复 查看 活动
0
5月 24
109
1
4月 24
87
0
3月 25
44
1
1月 24
131
1
11月 23
71