Black Friday 2026 50% off every plan Our biggest deal of the year on #1 Joomla products.
Ends in 12d 17h 24m 53s
Claim 50% off
Awaiting an answer Templates

override addon sppagebuilder in template

Asked by bepos 5 years ago Last activity 3 years ago

8 replies

Ofi Khan Staff

Hello bepos

The overrides work for all templates. It is the same process as in the documentation:

The standard output from any SP Page Builder addon can be overridden by adding code to the /sppagebuilder/addons/ directory of your front-end template. An override is a file or database entry that is loaded instead of the normal core file.

The steps are the followings:

  1. First, you need to copy selected addon folder from this directory:
    components/com_sppagebuilder/addons
  2. To this location, creating the appropriate directories in the event they don't already exist:
    templates/your_template/sppagebuilder/addons/
  3. Now you can safely edit the addon file(s):
    site.php - this file is to present front-end view with added content
    admin.php - this file is responsible for addon settings/content (text, chosen image, colors, links etc.).
  4. Save the file and your change will be visible.

I have tested with beez3 tempalte. It works as it should. I have overridden testimonial addon site.php file. The final location for the override is: templates/beez3/sppagebuilder/addons/testimonial/site.php

Best regards

bepos Asked this

Hi,

thanks for the reply.

I have set it up just like the example, but the code isn't loaded.

I'm using MightySites. Maybe it has something to do with that component. Any experience with that?

Regards, Mark

Ofi Khan Staff

Sorry, I have no experience with MightySites. You can check this on your localhost. Because I have tried on my localhost and the process should work for our templates, beez3, protostar and most of the templates.

bepos Asked this

From MightySites i got back that SPPageBuilder does not use the native Joomla API to get the current template and next check for overrides in /spppagebuilder folder (AddonParser::getTemplateName())

Not sure if this is true, but this might be the problem why the overrides are not loaded.

Can i, for test, change this code to JFactory::getApplication()->getTemplate() and see what happens? And where should i do this?

bepos Asked this

Hi,

after being informed by MightySites i made a small change in the core file addon-parser.php line 666 :

private static function getTemplateName()
  {

    if (Factory::getApplication()->isClient('site'))
    {
        return Factory::getApplication()->getTemplate();
    }

The result is that modifications in my template made in sppagebuilder/addons/articles/site.php are visible on my site.

I know it's a core modification and will dissappear after an update. So is it possible you make his change permanent? If it's not causing any issues of course.

Regards,
Mark

Ofi Khan Staff

okay. I will share this with the developer team for consideration. Thanks for your contribution.

bepos Asked this

You're welcome.

I'd love to hear about it when it's implemented or you have an other working solution

Regards,

Mark

Visioni srl

Hello, does this procedure for overriding addons also work with Joomla 4? Thanks

Log in to reply.