Adding class to links created inside a WYSIWYG field

6 posts by 2 authors in: Forums > CMS Builder
Last Post: September 12, 2008   (RSS)

By aev - September 8, 2008

Hi!

Can the WYSIWYG be configured to allow our clients to add a class for links they create inside the WYSIWYG?

I was thinking about a "Class:" input field below the Target and Title fields.

-aev-

Re: [aev] Adding class to links created inside a WYSIWYG field

By Dave - September 8, 2008

There's no automatic way to do that. The link popup is part of tinymce (the wysiwyg editor).

A few things you could try:

1) You could configure the wysiwyg to allow the user to select classes instead of font face & size and let them style the link after they create it.

2) You could add CSS code for anchor (a) tags to automatically style all of them

3) You could configure tinymce to use the 'advlink' plugin which includes a class pulldown and many other features) Here's a demo and some links on that:
http://tinymce.moxiecode.com/example_full.php
http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink
And you can edit the wysiwyg config options in /lib/wysiwyg.php

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [aev] Adding class to links created inside a WYSIWYG field

By Dave - September 11, 2008

Looks good, does it work now?

You can skip that 3rd step. We don't do any extra filtering of tags and it isn't required.

We've set verify_html to false as recommended in the TinyMCE Performance tuning docs:
http://wiki.moxiecode.com/index.php/TinyMCE:Performance_tuning_TinyMCE

Hope that helps, let me know if you need anything else.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Adding class to links created inside a WYSIWYG field

By aev - September 11, 2008

No, it doesn't work. The link button is still the same, and there is no new link button either.

Jake has all the login details if you care to take a look[:)]
[RRT #JSW-862797]

-aev-

Re: [aev] Adding class to links created inside a WYSIWYG field

By Dave - September 12, 2008

Note that we don't provide support for tinyMCE modifications.

I had a look anyway and the problem was tinyMce was missing the advlink plugin dir here:
/cmsb/tinymce3/plugins/advlink

I uploaded that from the source tinymce zip and deleted the old cache file: data//tiny_mce_7fde4892b674370bd5c181d18583c11c.gz

And it seems to be working now. Give it a try and let me know. You may need to clear your browser cache.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com