PlgEditors-xtd - class name problem #812

Closed
opened 2021-10-01 08:59:31 +00:00 by Llewellyn · 4 comments
Owner

Discussed in https://github.com/vdm-io/Joomla-Component-Builder/discussions/809

Originally posted by linpi1 September 29, 2021
I want to create an button as an editor extension. In the php file, the default class name of the plugin starts with PlgEditors-xtd + the plugin name, example class PlgEditors-xtdBookshopButton extends CMSPlugin. This dash in the class name makes an error in PHPStorm and also when I open an article: syntax error, unexpected '-', expecting '{'
Therefore I changed the class name to PlgEditors_xtdBookshopButton. No error anymore.
But I cant not just change it with /***[REPLACE<>$$$$]***/ this make a compilation warning:
Custom Code Warning File plugin_editors-xtd_bookshopbutton/bookshopbutton.php could not be found, so the custom code for this file could not be addded.
So what to do know?

Another thing, the expected button doesn't appear in the editor. I compared the code (function onDisplay($name)) with editor-xtd/article.php and it is almost the same, but still no button. Is there something missing to add ?

### Discussed in https://github.com/vdm-io/Joomla-Component-Builder/discussions/809 <div type='discussions-op-text'> <sup>Originally posted by **linpi1** September 29, 2021</sup> I want to create an button as an editor extension. In the php file, the default class name of the plugin starts with PlgEditors-xtd + the plugin name, example class PlgEditors-xtdBookshopButton extends CMSPlugin. This dash in the class name makes an error in PHPStorm and also when I open an article: `syntax error, unexpected '-', expecting '{' ` Therefore I changed the class name to PlgEditors_xtdBookshopButton. No error anymore. But I cant not just change it with `/***[REPLACE<>$$$$]***/` this make a compilation warning: `Custom Code Warning File plugin_editors-xtd_bookshopbutton/bookshopbutton.php could not be found, so the custom code for this file could not be addded.` So what to do know? Another thing, the expected button doesn't appear in the editor. I compared the code (function onDisplay($name)) with editor-xtd/article.php and it is almost the same, but still no button. Is there something missing to add ? </div>
linpi1 commented 2021-12-31 16:17:19 +00:00 (Migrated from github.com)
Author
Owner

for a editor extension, the class has always to be: PlgButton{PluginName}
example: name of the plugin: BookshopButton
what JCB produce:
class PlgEditors-xtdBookshopButton extends CMSPlugin
what it should produce:
class PlgButtonBookshopButton extends CMSPlugin

for a editor extension, the class has always to be: `PlgButton{PluginName}` example: name of the plugin: BookshopButton what JCB produce: `class PlgEditors-xtdBookshopButton extends CMSPlugin` what it should produce: `class PlgButtonBookshopButton extends CMSPlugin`
Author
Owner

@linpi1 if you get a moment please check the code from d57f35fc00 if it resolve the issue.

@linpi1 if you get a moment please check the code from https://github.com/vdm-io/Joomla-Component-Builder/pull/871/commits/d57f35fc006ce1dc189bf5af30358e6cf2e8891c if it resolve the issue.
Author
Owner

I have now update the staging branch with these new changes... please will you also test that?

I have now [update the staging branch](https://github.com/vdm-io/Joomla-Component-Builder/commit/278f70c8a65f4d966aa548b58883c2db0a8fa106) with these new changes... please will you also test that?
Author
Owner

Okay this issue has been resolved far as I can tell.

Okay this issue has been resolved far as I can tell.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#812
No description provided.