Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.3] Custom shortcodes for TinyMCE #44506

Open
universewrld opened this issue Nov 22, 2024 · 23 comments
Open

[5.3] Custom shortcodes for TinyMCE #44506

universewrld opened this issue Nov 22, 2024 · 23 comments

Comments

@universewrld
Copy link

Is your feature request related to a problem? Please describe.

Since version 5.2, @joomla offers to create custom styles for links in the TinyMCE settings, but there is nothing similar for embedded content.

Describe the solution you'd like

I suggest adding the ability to create your own custom shortcodes in the TinyMCE settings.
I don't see the need to load third-party components with third-party libraries and scripts for such a basic feature.

Additional context

Out of the box shortcodes will be a great solution, replacing all possible third-party components for embedded content.
Websites on Joomla should be as fast as possible, and third-party developers like to add their huge third-party libraries and scripts for such a basic feature, which makes the website load much longer than it should.

Each administrator would be able to create their own set of shortcodes, instead of loading huge libraries of shortcodes from third-party developers on every page of their website.

@brianteeman
Copy link
Contributor

That is a massive feature request

@Quy Quy added the Feature label Nov 22, 2024
@universewrld
Copy link
Author

Image

that's what i mean but for shortcodes so that everyone can add their own shortcodes for their website.

@brianteeman
Copy link
Contributor

and where (and how) do you create these magical shortcodes

@brianteeman
Copy link
Contributor

Are you ever going to reply to my question. As it stands your request can not move forward as it doesnt make any sense.

@universewrld
Copy link
Author

universewrld commented Nov 27, 2024

and where (and how) do you create these magical shortcodes

in the TinyMCE settings, just like now, you can create language tags and styles for links.

The TinyMCE editor for editors will have 1 additional button shortcodes, with which you can add a shortcode to an article, just as there is now an additional button for custom language tags.

@brianteeman
Copy link
Contributor

and what do these shortcodes do, where do they come from? Please give an example of one of these shortcodes

@HLeithner
Copy link
Member

I would expect he or she talks about https://www.tiny.cloud/docs/tinymce/latest/keyboard-shortcuts/ which should possible to implement. if the topic is https://www.tiny.cloud/docs/tinymce/latest/shortcuts/ then I think it is much harder

@brianteeman
Copy link
Contributor

brianteeman commented Nov 27, 2024

I would expect he or she talks about https://www.tiny.cloud/docs/tinymce/latest/keyboard-shortcuts/ which should possible to implement.

It's already part of core

if the topic is https://www.tiny.cloud/docs/tinymce/latest/shortcuts/ then I think it is much harder

Not really. I had a PR for this but it was rejected so I made it available as a plugin from my ghithub

[edit] it would be hard to make it customisable by the site owner

But neither of them sound like anything to do with embedded content or

Each administrator would be able to create their own set of shortcodes, instead of loading huge libraries of shortcodes from third-party developers on every page of their website.

@HLeithner
Copy link
Member

So he means something like "autotext" in word? where for example entering (in german) "mfg" extends to "Mit freundlichen Grüßen"?

@brianteeman
Copy link
Contributor

i have no idea - that is what I am waiting to hear. I have my suspicions based on wp but am waiting for @universewrld to respond

@universewrld
Copy link
Author

keyboard shortcuts

that's not what I mean

and what do these shortcodes do, where do they come from? Please give an example of one of these shortcodes

for the editor in TinyMCE this code will look like:
{youtube|kDE71jxAvfg|/youtube}

on the front this code will be generated as:
<iframe width="560" height="315" src="https://www.youtube.com/embed/kDE71jxAvfg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

in the TinyMCE settings it would look something like this:

Name: YouTube
Value 1: <iframe width="560" height="315" src="https://www.youtube.com/embed/
Value 2: " title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

@brianteeman
Copy link
Contributor

Why would you do that when tinymce already supports embedding of youtube videos https://www.youtube.com/watch?v=ul3mcXMX0gA&ab_channel=LearnJoomla4

@universewrld
Copy link
Author

Why would you do that when tinymce already supports embedding of youtube videos https://www.youtube.com/watch?v=ul3mcXMX0gA&ab_channel=LearnJoomla4

YouTube was just one of many examples, in fact, custom shortcodes will be able to support any iframes, any bootstrap elements, any icon tags (font awesome and the like), this immediately solves all the issues with embedding any content in articles, as well as the ability to change the code of any services in one click (in the past, websites switched from http to https, and instead of twitter.com, the x.com domain is now used).

@HLeithner
Copy link
Member

ok, so you want an interface to create an interface for macros. If someone like to creates such a tinymce plugin we could add it but it's in your scope to find someone who likes to develop someone if no body picks this up.

@brianteeman
Copy link
Contributor

Youtube was just one example of the built in embedding features already present in tinymce

Your http/https example would NOT be solved.

Your shortcodes (unlike existing content plugins) will only run inside tinymce and the code they generate would be saved in the content item. Going back into the tinymce plugin settings and changing the values of your shortcode would NOT change any existing content.

@universewrld
Copy link
Author

Youtube was just one example of the built in embedding features already present in tinymce

Your http/https example would NOT be solved.

Your shortcodes (unlike existing content plugins) will only run inside tinymce and the code they generate would be saved in the content item. Going back into the tinymce plugin settings and changing the values of your shortcode would NOT change any existing content.

This is not for existing content, this is for any content from the moment editors start using this feature and for changing the code in shortcodes in the future.

@brianteeman
Copy link
Contributor

Tinymce does not work like that so what you are asking for is impossible

@universewrld
Copy link
Author

Tinymce does not work like that so what you are asking for is impossible

it could be just a request for custom shortcodes outside of TimyMCE

@brianteeman
Copy link
Contributor

Then it would be no different to the very many extensions that already do this.

@universewrld
Copy link
Author

Then it would be no different to the very many extensions that already do this.

The problem with third party extensions is that they offer a huge set of pre-installed shortcodes and load a large library which causes website pages to take longer to load, which is why I created a feature request so that there would be a feature that would allow you to add your own shortcodes for each specific website, not using third party extensions.

@brianteeman
Copy link
Contributor

I am not aware of any extension like that

@ManuelVoileux
Copy link

ManuelVoileux commented Dec 2, 2024

Dear all, what @universewrld is asking for already exists. It is an extension called UP! I use it everyday to tune the voileux.org website, and the joom.voileux.org website.

With a simple shortcode in the editor tab you can call one of the 142 actions available with UP! You can display images, display videos, change the look and feel of any page, add css in the head, convert a CSV file into a table. A miracle for non coding webmasters. Up! is compatible with Joomla 5 without the compat plugin.

{up image-gallery=folder} directly in the article will show an image gallery, with paramaters you can tune the look&feel.
{up flexauto=2 | tablet=2| mobile=1 | class=fg-gap} will distribute blocks evenly according to your choice

Have a look at [https://up.lomart.fr/] Lomart is well known in the Joomla French community.
Up! is given for free

@universewrld
Copy link
Author

With a simple shortcode in the editor tab you can call one of the 142 actions available with UP! You can display images, display videos, change the look and feel of any page, add css in the head, convert a CSV file into a table.

that's what i meant - i don't want to depend on 3rd party developers and i want to be able to add my own shortcodes.

i had a really bad experience when i migrated my website from Joomla 1.5 to 2.5 and then from 2.5 to 3.4 and then from 3.9 to 5.2, many 3rd party extensions that i used on my website stopped being supported at one point and i had to look for a replacement every time i migrated Joomla to a new major version.

i'm really tired of many developers stopping supporting their extensions and i have to look for an alternative extension every time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants