[Qgis-user] action to open an HTML file with arguments

Stephen Sacks ssacks456 at gmail.com
Fri Sep 8 18:35:29 PDT 2023


    I want to create a situation where clicking on a feature in a vector 
layer opens  an HTML file and passes several attributes of the feature 
to the HTML file.  I have successfully created an action which opens the 
HTML file, but I can't figure out how to pass the arguments.
    My action "type"  is "open" and if the "Action Text"  is
              C:/temp/receiveParms.html
then the web page opens.  But if the "Action Text"  is
              C:/temp/receiveParms.html?arg1=C&arg2=D
the web page fails to open.  I also tried
              C:/temp/receiveParms.html?arg1="C"&arg2="D"
and
              C:/temp/receiveParms.html?arg1=[% "garden" %]
where "garden" is the name of an attribute.
All of these efforts to pass arguments to an HTML file fail to open the 
file.

In order to verify that receiveParms.html knows how to accept arguments, 
I wrote sendParms.html which includes the following line:
<a href="C:\temp\receiveParms.html?arg1=abc&arg2=xyz">
This works as expected, successfully passing two parameters.
I'm attaching the two HTML files.
    I'd be grateful if someone can tell me what I'm doing wrong.
    Thanks in advance for any suggestions.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230908/9f91e003/attachment.htm>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230908/9f91e003/attachment.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230908/9f91e003/attachment-0001.html>


More information about the QGIS-User mailing list