Creating Custom Addons Joomla 4 - Question | JoomShaper
Black Friday sale is live with flat 50% OFF. Sale ends soon! Grab your deal now!

Creating Custom Addons Joomla 4

Ralf N.

Ralf N.

SP Page Builder 3 years ago

I tried to follow up the Tutorial i found on your Blog: https://www.joomshaper.com/blog/how-to-create-a-custom-addon-for-sp-page-builder

But it is not working on J4 - i spent multiple hours for searching the mistake but there must be a difference for J4. The adminpart of the module is running but it is not rendered on the frontend. I just took your example and renamed it - no more changes - it is not rendered.

As i work on a bigger project on J4 i will need the information where the difference should be.

Thanks an best Ralf

0
12 Answers
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 3 years ago #66949

Hello Ralf N.

Thanks for bringing up the issue. Yes, the process seems like obsolete now for Joomla 4. We will upgrade the blog and publish a new one.

Best regards

0
Ralf N.
Ralf N.
Accepted Answer
3 years ago #66956

One detail is confusing: the example you provide is working if i do no changes and just installing it- but as soon i change only the names - without touching the real ouput code it won't render the frontend. Thats the point i get in struggle...

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 3 years ago #66960

I have checked the process. Changed the name and details. It works on Joomla 3 but does not work on Joomla 4. I have forwarded the issue to the team. They will update it.

0
Ralf N.
Ralf N.
Accepted Answer
3 years ago #67586

Any News on this? I need a solution asap please..

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 3 years ago #67626

Sorry for the unwanted delay. It will take time. We have not looked out on this while Joomla 4 arrives. We will check the issue with Joomla 4 and update the documentation. We might publish a article on it too. Please stay tuned.

0
Ralf N.
Ralf N.
Accepted Answer
3 years ago #71747

Again - any News on this topic?

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 3 years ago #71788

Sorry, it is still not fixed. It is on the developer's table.

0
GB
Geraint Brown
Accepted Answer
3 years ago #71877

Hi Ralf,

I haven't created a custom addon for PageBuilder, but since it requires a Joomla plugin, you will need to update a number of the files/classes to match J4 conventions.

Checking some of Pagebuilder's J4 addons will help with this.

There's a distinct likelihood that the addons now use namespacing too, if following J4 conventions.

A quick look at the tutorial, I see some obvious changes that will be required:

REF: step 2 of the JoomShaper guide

  1. Re-write the PHP plugin class to match the Joomla 4 plugin signatures. N.B. [PlgSppagebuilderDemo] extends JPlugin will need to be replaced with PlgSppagebuilderDemo extends CMSPlugin. Naturally, if namespacing is used, instead of include/require statements, you'll replace these with the appropriate use statements.
  2. The XML manifest file will require updating to match J4. Again, looking at any existing addons will help with this, but your extension version="3.8" will of course need updating.

This should get you most of the way, I hope.

Finally, there's an example plugin for Joomla 4 on the Joomla Wiki here, that I hope will provide additional context for #1 above.

Hope it helps,

Gez

0
Ralf N.
Ralf N.
Accepted Answer
3 years ago #71889

@Geraint Brown: No this is not the solution - but i have found the big failure on Joomshapers tutorial!

@Ofi Khan: On Step4 of the Turtorial - changing site.php file is written:

"The important thing to do here is to change the class name from “SppagebuilderAddonSample_addon” to “SampleBuilderAddonYour_addon” and whenever you are going to name a div, use this format “sppb-addon-sample-addon”."

But this is wrong and needs to be changed to:

"The important thing to do here is to change the class name from “SppagebuilderAddonSample_addon” to “SppagebuilderAddonYour_addon” ".... so the class SampleBuilderAddon wording is complete wrong!!!!

This costs me hours / the whole night :( - please slap the editor of this tutorial as it ruined it totaly ;-P

1
GB
Geraint Brown
Accepted Answer
3 years ago #72161

Ralf,

Firstly and to be clear, I didn't state that what I offered was a "solution". In fact, I stated emphatically, that I had not developed an addon of my own, and therefore, what I proposed were changes to the part of the tutorial that referenced creating a Joomla plugin.

N.B. The JPlugin class does not exist in J4, and therefore, should be updated per my example.

Secondly, whether one provides the solution or not, its curtious to at least thank the respondent, not berate them. As frustrating as it can be when things don't work, getting angry about it, very rarely yields the desired outcome.

Regards,

Geraint

0
Ralf N.
Ralf N.
Accepted Answer
3 years ago #72165

Sorry Geraint that i forgot to say thanks for your answer - it was just pretty late in the morning! Of course every answer and way how to solve problems is appreciated.

0
GB
Geraint Brown
Accepted Answer
3 years ago #72168

Appreciated. Thanks,

Geraint

0