Question

Convert the text field to the hyperlink

Hi,

 

I would like to put a hyperlink to an external source on the contact page (not in the link and attachment tab but in the main info). Is it possible to convert the text field to the hyperlink?

Like 0

Like

5 comments

Hello Paulina,

 

Hope you're doing well.

 

In case you would like to make the field a hyperlink you will need to use development tools. Here you can find the approximate algorithm on how your business task can be performed:

  • You will need to modify diff of the needed field in the next way:
diff 
{
	"operation": "insert",
	"name": "AdditionalExpenses",
	"values": {
 
		// -->
		"showValueAsLink": true,
		"controlConfig": {
			"enabled": true,
			"href": {
				"bindTo": "getAdditionalExpensesLink"
			},
			"linkclick": {
				"bindTo": "onExternalLinkClick"
			}
		},
		// <--
 
		"layout": {
			"colSpan": 12,
			"rowSpan": 1,
			"column": 0,
			"row": 3,
			"layoutName": "Tab07720f4eTabLabelGridLayout691629ea"
		},
		"labelConfig": {},
		"enabled": true,
		"bindTo": "AdditionalExpenses"
	},
	"parentName": "Tab07720f4eTabLabelGridLayout691629ea",
	"propertyName": "items",
	"index": 5
},
  • After that, please add such code to the methods:
methods: {
 
	getAdditionalExpensesLink: function() {
		return this.getLink(this.get("AdditionalExpenses"));
	},
	onExternalLinkClick: function() {
		return;
	},
	getLink: function(value) {
		if (Terrasoft.isUrl(value)) {
			return {
				url: value,
				caption: value
			};
		}
	}
},

As a result, the needed field will be a hyperlink field if you will populate it with the appropriate link format (or just copy and put it from the browser address bar).

 

Best regards,

Roman

Hi Paulina,

I've written up the steps to convert the text field to a clickable hyperlink here: https://customerfx.com/article/how-to-format-a-url-as-a-clickable-link-…

Ryan

Hi All,

The above code works and converts the text into Hyperlink.

But I see an issue when I try to delete the text.

 

Issue detail -> I select the text and click on delete, it gets removed,  then when we click just outside of the field, the text/link it appears again.

 

-> If I select the text and click on delete, and click on save, close and re-open, the text actually deleted.

Ryan Farley,

The page which you prepared it works fine

Roman Rak,

Hello

Tell me whether it is possible to add a hyperlink to the text itself, that is, to have a certain text. For example, the name of the company, and a hyperlink sewn into it. 

Show all comments