3

I want to enable capture of additional information for inline links for the rtf. This additional information/attributes are standard html tags like is it new window or pop up for the target or window attributes like height/width but which are not available OOTB in the Tridion WYSIWYG editor when we insert inline links.

I wanted to check if there is an api available to extend the editor to include the additional attributes I want to capture with the inline links.
OR
If there is a way to add additional buttons/controls in the WYSIWYG editor to enable capturing of this information wherein I will specify what I want to capture as part of the link.

2 Answers 2

3

What you're trying to accomplish can be done with a GUI extension. The Tridion GUI is extensible, but specifically extending those features in the WYSIWYG is much more difficult. This is because the data from the link window isn't easily accessible in the main browser session.

With that said, Alex Klock has an excellent blog post on how he developed a GUI extension for this.

You will need:

  • a JavaScript file that modifies the link popup window
  • A second JS file that handles storing the link attributes
  • A stylesheet for styling those tweaks to the popup
  • To Create an extension group for Tridion.Web.UI.Editors.CME.Views.Popups.Link
  • To develop a TBB to resolve your output

Alex outlined the basics of this here: http://codedweapon.com/2014/08/customizing-an-existing-tridion-popup-dialog/

The strategy amounts to "tricking" the Tridion UI to take your extra attributes and append them to the href of the link. You would then use a template building block to strip out those attributes and add them as proper HTML attributes to the containing element.

To my knowledge, there isn't really an easier way to get information from that link popup into the main session (believe me, I tried)

0
3

The title attribute, which shows as "hover text" in certain browsers, and the target attribute are part of the rich text format (RTF) area hyperlink options. :-)

Additionally you can allow CSS styles for certain RTF fields, which you could template or convert to a different output.

For additional RTF features, you could consider a GUI extension (Anguilla framework).

Where possible, though, I would template certain attributes, possibly pulling the information from the linked item. For example, links to a certain "pop-up" Component might automatically set a certain type of Target attribute or add the CSS and script to create a pop-up.

Update: examples of Rich Text Format Area GUI extensions:

You'll need to consider or create an extension for both the Content Manager Explorer and Experience Manager.

The alternative to a GUI extension would be a Custom URL. This would be a "lighter" approach at offering editors custom functionality. They would click on a field's description field and a pop-up page you create will let them set and change values.

Either approach requires at least some HTML and client-side development. GUI Extensions are more of a framework than API. If you extend the UI to make this easier for editors, I would recommend one more step to offer good defaults, selectable options, and some contraints. For example, it'll probably be easier to choose from a set of pop-up sizes rather than enter height and width each time.

3
  • Edited the question to remove ambiguity :) My intent was to capture additional information when the user creates these inline links like link should open in new window, what is the window attributes (height, width) and this should be user input. I am looking at capturing this when user creates these links and then templating I can modify to render the same. Commented Apr 1, 2015 at 18:06
  • Okay, this could be all templating if the window size is consistent anytime you use a certain link (pop-up). The template or the pop-up could have the height and width values. If you want to modify Tridion's linking behavior, you'll likely want an RTF extension. I'll update my answer with a few examples from the community. Commented Apr 1, 2015 at 20:11
  • thanks for sharing the examples. I am going to look into using #1 or #2 and pick one which fits our needs Commented Apr 2, 2015 at 22:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.