Closed JLTRY closed 1 month ago
@parapente could you please check the plugin. It works with at least joomla 5
@JLTRY I would suggest to make some changes for the plugin to fully work correctly for both Joomla 4 and 5. In InsertAttachmentToken.php line 128:
$js = "
function insertAttachmentsToken(editorName) {
let editor = Joomla.editors.instances[editorName];
let content = editor.getValue();
if (content.match(/\{\s*attachments/i)) {
alert('$present');
return false;
} else {
editor.replaceSelection('<span class=\"hide_attachments_token\">{attachments}</span>');
}
}
";
This fixes the {attachments} tag placement in the editor.
Also just before the return $button
:
$button->link = '#';
This fixes compatibility with Joomla 4 and it should be ready for merging.
Oh I forgot one thing, comment the $button->title line as otherwise it shows the description as the button title making it huge. The $button->text is enough.
Hello I will do the modifications when I will be back . I am in vacations for 10 days
Hello @parapente I added your remarks and tested it OK for Joomla 4 and Joomla 5
Rewrite insert attachment token with Joomla 4 like implementation