Override Addon Sppagebuilder In Template - Question | JoomShaper

Override Addon Sppagebuilder In Template

bepos

bepos

Template 2 years ago

Hi,

i'm trying to make an override as described on https://www.joomshaper.com/documentation/sp-page-builder/sp-page-builder-3/how-to-tips

With theme shaper_helixultimate it works, but not with other themes like beez3. Should i add code to the theme?

Looking forward for your reply.

Regards, Mark

0
8 Answers
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 2 years ago #43226

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

0
bepos
bepos
Accepted Answer
2 years ago #43236

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

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 2 years ago #43258

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.

0
bepos
bepos
Accepted Answer
2 years ago #43465

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?

0
bepos
bepos
Accepted Answer
2 years ago #43643

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

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 2 years ago #43690

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

0
bepos
bepos
Accepted Answer
2 years ago #43694

You're welcome.

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

Regards,

Mark

0
VS
Visioni srl
Accepted Answer
11 months ago #117779

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

0