I am trying to work out how can I add a relative path hyperlink to a shapefile in QGIS. I have found several great tips on various forums but only one has so far potential to be implemented. The overall goal is for the end user to be able to access a hyperlinked pdf/png/jpg etc without me having to set up any software dependencies under layer properties Actions tab in QGIS. I assume that the end user will have the software required to open a document but I would like the end user's computer to choose a default program to open the files. One of the possibilities would be to use a 'Python' action which I located on one of the forums which after several modifications did not work for me: http://lists.osgeo.org/pipermail/qgis-user/2011-May/012117.html.
Here is the screenshot of my layer's action properties:
In the attribute table, the column with hyperlink is called 'PDF and the relative hyperlink is: /doc/document.pdf
My folder structure is:
- /HyperlinksTest -- /data --- Renewable_Energy_Zones.shp -- /doc --- document.pdf HyperlinksTesting.qgis
When I identify the feature, I get the following Python error:
Am I using wrong variables in the Python code? Is there any other way of using relative paths in hyperlinking data to external documents? I noticed there is eVis extension but as far as I see it relies on specyfying software to open a document with, which I'd like to avoid.
Many thanks, Magda