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

TinyMCE ability to add class to hyperlink #512

Closed
fourroses666 opened this issue Feb 20, 2018 · 10 comments
Closed

TinyMCE ability to add class to hyperlink #512

fourroses666 opened this issue Feb 20, 2018 · 10 comments

Comments

@fourroses666
Copy link

fourroses666 commented Feb 20, 2018

I would like to give a class to a hyperlink in TinyMCE.
Would that be possible to add that field? (Maybe its already possible where I'm not aware of.)


Also have a less important thing I'd love to be able to do;
That is being able to give a hyperlink to an image instead of a File on the server.

tiny

My aim is to add a popup to a link which shows an image of video in a lightbox.
I can do that when the link has a class (popup or video).

@fourroses666 fourroses666 changed the title TinyMCE ability to add class to link TinyMCE ability to add class to hyperlink Feb 20, 2018
@modxuser
Copy link

Not sure but this might be what you are looking for:
https://www.tinymce.com/docs/plugins/link/#link_class_list

@fourroses666
Copy link
Author

Yes, any idea if this can be added in the Plugin configuration?
In the Custom Parameters?

Maybe @Deesen knows?

@Deesen
Copy link

Deesen commented Feb 20, 2018

Yes acc. to https://www.tinymce.com/docs/plugins/link/#link_class_list just add to the theme you want:

$this->set('link_class_list', "[
    {title: 'None', value: ''},
    {title: 'Dog', value: 'dog'},
    {title: 'Cat', value: 'cat'}
]", 'json' );

@fourroses666
Copy link
Author

I have choosen a custom theme and added the link class but I guess I'm missing something?
TinyMCE stops working after adding that.

/assets/plugins/tinymce4/theme/theme.tinymce4.new.inc.php

@Deesen
Copy link

Deesen commented Feb 20, 2018

Sorry, " and ' need to be switched, so the right code is below. Tested and works:

$this->set('link_class_list', '[
    {title: "None", value: ""},
    {title: "Dog", value: "dog"},
    {title: "Cat", value: "cat"}
]', 'json' );

@fourroses666
Copy link
Author

Works, thanks :))


Adding a switch in KCFinder from Files to Images would solve my "problem".
Than its possible to link to images instead of only files.

@Deesen
Copy link

Deesen commented Feb 22, 2018

Maybe a new button like this helps? It will copy the image-src to the URL-input.

assets\plugins\tinymce4\tinymce\plugins\modxlink\ plugin.min.zip

image

@risingisland
Copy link

I like this idea.
I just added this to tinymce, but the new button is not showing up for me.

@Deesen
Copy link

Deesen commented Feb 22, 2018

Maybe a browser-cache issue?

@fourroses666
Copy link
Author

Is it possible to select an other image from the images folder? Because that would be the best situation in some cases. :-0

So place a thumb and then link to a large image (add class for the lightbox is already possible with the custom theme so thats great) Or when you would like to add a image “lightbox popup” on a hyperlink.

So thats why I thought adding the Files/Images switch in KCFinder was perfect. Some dropdown switch.

But I’m kinda oke with this too. It would help a bit.

@pmfx pmfx closed this as completed Mar 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants