You are viewing limited content. For full access, please sign in.

Question

Question

Any way to add a clickable link in the Text field of a WebLink search form

asked on April 29

Hello,

I am building a search form within our WebLink environment and would like to have a text field with instructions for the user as well as a link to an outside resource. Since WebLink does not have a custom HTML field option, like Forms, is there a way to have an HTML link?

Thanks!

0 0

Replies

replied on April 29

In the search form, you can add a text field with certain CSS class.

Then you can customize the custom search page by editing CustomSearch.aspx file the under folder C:\Program Files\Laserfiche\WebLink\WebLink\Web Files, and modify the element with this certain CSS class.

The text field may not appear on form load so an example script is like:

    <script type="application/javascript">
	const interval = setInterval(() => {
	const el = document.querySelector('.target-element');
		if (el) {
			const link = document.createElement('a');
			link.href = 'https://example.com';
			link.textContent = 'More info';
			el.insertAdjacentElement('afterend', link);
			clearInterval(interval); // stop checking
		}
	}, 500); // check every 500ms
    </script>

 

0 0
replied on April 30 • Show version history

Thanks, I'll give it a try. I'm newer to CSS, so in this case, is your CSS class "el"? So you would add el to the CSS class field for the plain text field? Speaking of CSS, is there a specific CSS file that the custom searches are using? I tried adding classes to a couple of sheets, but don't notice any changes to the formatting in my custom search, so wasn't sure if I was updating the wrong CSS file, or if I was entering them wrong

0 0
replied on May 6

The class is "target-element". The "el" is a variable name used in this script only.

As for the CSS file, you can use the "styles.css" under C:\Program Files\Laserfiche\WebLink\WebLink\Web Files

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.