Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Make a URL a clickable link
Make a URL a clickable link
In the browse form, I have some url's.
Ultimately, I'd like to wrap those urls in html to make them clickable when displayed on the Print page (and downloaded/saved) when using the Print button.
How to accomplish this?You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4584
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 536 times
- Contact:
Re: Make a URL a clickable link
Do I understand correctly that the links in the browse view are not supposed to be clickable — only in the “print” mode?
Maybe one possible solution would be to add an additional column in the browse view that contains the clickable URL, but keep it hidden there.
Then, when “print” is clicked, that column could be shown instead?
Maybe one possible solution would be to add an additional column in the browse view that contains the clickable URL, but keep it hidden there.
Then, when “print” is clicked, that column could be shown instead?
Re: Make a URL a clickable link
Yes, your idea as stated above might be the solution. How would I implement that?
-
- nuBuilder Team
- Posts: 4584
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 536 times
- Contact:
Re: Make a URL a clickable link
For each URL field, create an additional column that contains the same URL wrapped in an <a> tag.
Example:
In this example, the original column is named
The second column, which displays the clickable link, is defined as:
Set the width of the clickable column to 0, since it should not be visible in the Browse view.
Then, in Custom Code → Browse Field, exclude the non-clickable column and include the clickable one:
Of course, if you’re already using nuPrintIncludeColumns() or nuPrintExcludeColumns(), you’ll need to merge your column lists accordingly.
Example:
In this example, the original column is named
url_audio
.The second column, which displays the clickable link, is defined as:
CONCAT('<a href="', url_audio, '" target="_blank">Audio</a>')
Set the width of the clickable column to 0, since it should not be visible in the Browse view.
Then, in Custom Code → Browse Field, exclude the non-clickable column and include the clickable one:
Code: Select all
nuPrintExcludeColumns([0]); // Exclude the plain URL column
nuPrintIncludeColumns([1]); // Include the clickable URL column
You do not have the required permissions to view the files attached to this post.