Hyperlink in Text

0
Hi All,We have one requirement where user can add a freeform text in a text area. User can also add a hyperlink along with the other text. Whenever user enters the hyperlink, the same should be stored as link in DB and when we display it again, it should display as Hyperlink and by clicking on it the same should open in a different tab.Any ideas to achieve the same?RegardsAjay
asked
2 answers
0

Hi Ajay,


The best approach is to use a Rich Text Editor widget from the Marketplace instead of a normal text area. This allows users to enter text and add hyperlinks directly.

The hyperlink will be stored in the database as HTML, and when you display it using a Text widget with Render HTML enabled, it will appear as a clickable link. You can also configure it to open in a new tab using target = "_blank".


Regards,

Reemali

answered
0

1. Use Rich Text / HTML Editor

Use one of the following:

  • Rich Text widget (CKEditor / Rich Text Editor – Marketplace)
  • or HTML Snippet + Rich text input

This allows users to:

  • Enter free text
  • Insert hyperlinks
  • Store formatted content

The value will be saved as HTML in the database.

Example stored value:



Please check <a href="https://example.com" target="_blank">this link</a>

2. Store Attribute as

Entity Attribute → String (Unlimited)

This is required because HTML content can be large.

3. Display the Content as Hyperlink

When showing data:

Use:

HTML Snippet widget

Set:



Content → Attribute (HTML text)

This renders links correctly.

4. Open Link in New Tab

Ensure links contain:



target="_blank"

Most Rich Text editors automatically support this, or you can sanitize/update before save using a microflow.

Recommended Security Step

Enable HTML sanitization to prevent unsafe scripts:

  • Use HTML Sanitizer
  • Allow only safe tags (a, p, br, etc.)

answered