I have a string field called PIN
. And I have a string field called PIN_SOA
which has URLs.
I'm creating a webmap using qgis2web 3.16. I have popups enabled, and of the two mentioned fields I only want to see PIN in the popup, not PIN_SOA. Here's how it looks now:
Is there a way to make PIN a hyperlink that opens the URL of the associated PIN_SOA field? For example, I want it to look like this:
I'm referencing these similar questions. QGIS - Convert a text field to a clickable hyperlink, hotlink, or URL?, Configuring URL link for popup window directly in qgis2web plugin?
1 Answer 1
You can use a third field to show the link.
Creating a new field with an expression like this:
'<a href='+ "PIN_SOA" +'>'+ to_string("PIN") +'</a>'
The link will remain the same link, you just style it in a way that is comfortable to you.
To prevent some fields to be shown in the popup I would copy my layer to a virtual layer and use the new temp layer with only the fields you want in the popup.
-
I created a new field with that expression, but it didn't put the whole link in there--only willcountysoa.com/propertysearchPfalbaum– Pfalbaum2020年10月15日 02:39:13 +00:00Commented Oct 15, 2020 at 2:39
-
Update: It didn't put the whole link because I didn't make the field length long enough.Pfalbaum– Pfalbaum2020年10月15日 02:50:55 +00:00Commented Oct 15, 2020 at 2:50