Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Displaying a hyperlink with text instead of the URL, via calculated value

 Hi, I would like to generate the content of an HTML custom attibute, using Attribute Customization > Calculated Value. I want the field to contain a hyperlink, which would display a clickable text instead of the URL (e.g. display "Google" instead of www.google.com).

I know it is possible for users to generate this link manually via the "Insert External Link" in the WebUI toolbar. How can I do that with calculated value?

Note that I only use the WebUI, v3.0.1.2.

Thanks!

1 vote


Accepted answer

Permanent link

This has been discussed in several other questions. Here the answer as it is:

  • When using JavaScript attribute customization https://jazz.net/wiki/bin/view/Main/AttributeCustomization I am not aware of a way to create the HTML syntax and get it working in the attribute. When passing a string with the right content, the string content is converted into an XML string and all the tags in it are basically escaped. (internally using XMLString.createFromPlainText()
  • With a Java Based attribute customization you should be able to use  XMLString.createFromXMLText() and avoid the escaping
  • In other Java based extensions you can set attributes accordingly using XMLString.createFromXMLText()

Ralph Schoon selected this answer as the correct answer

0 votes

Comments

Using the Wiki Syntax, you can use a Wiki type attribute and create a valid HTML link there. http://wikicreole.org/ explains the supported syntax.


6 other answers

Permanent link
Hi,

I would suggest to get the content of such an example attribute and look at the syntax in the plain text.

0 votes


Permanent link
 If I export the content of the attribute in plain text it only shows the text, not the link...

0 votes

Comments

Have you tried to use the API to get the content?

I don't use / know how to use the API... 


Permanent link
I used a script to peek and the text it uses for a hyperlink is unsurprisingly HTM syntax:

[a href="someURL"]Some Text[/a]

(Replace [ by <)

This works for HTML attributes. Wiki Type attributes use the documented Wiki Syntax.
In Links on the inks tab the comment is used.

0 votes


Permanent link
I have tried to set a custom HTML attribute with the default value:
«a href="http://google.com"»Click here«/a»
(with < instead of « and > instead of »)
The presentation is also HTML. But the text displays as above (including visible HTML tags), with the URL part automatically converted to a link. So this does not work for me...

0 votes

Comments

I tried using Attribute customization and using a script. I see the same you see.

I also can not get the link text to be displayed instead of the actual link location, neither with Wiki nor with an HTML attribute. Any news with regard to this?


Permanent link
Any updates?

0 votes


Permanent link

 If we add a custom attribute of type Large HTML where we can assign the Some text the url value and add it in the editor presentation were we wnat to call. Then this is possible.






0 votes

Comments

I suggest you really read the accepted answer.

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,019

Question asked: Nov 16 '12, 4:53 a.m.

Question was seen: 21,074 times

Last updated: Dec 08 '17, 8:55 a.m.

Confirmation Cancel Confirm