So your web site talks a lot about travelling and has photos about all sorts of places? And you would like to link to all those resources on a map like this. Well, if you happen to use PostNuke for your site we got the right hack for you.
After upgrading PostNuke recently and playing with the Google Maps API in a hard coded HTML for a bit I decided that maintaining the HTML file is just too painful. After all we are using PostNuke as a content management system on the site. And the HTML was not even within the site itself. So I migrated the HTML to a PHP file based on blank.php. Since that was still to painful I decided to hack a file together that takes links from the PostNuke web links core module and uses those on the map. And after a bit of hacking I am proud to release weblinksmap.php to you.
Download the release from here and read the weblinksmap_readme.txt for more instructions. An updated and maintained version of the instructions can be found in the following.
This is pretty much a hack. A proper solution would be to add two new field (latitude and longitude) to the web links related tables in PostNuke. Add input for those fields in the administration system and various outputs in the different web links displays. In addition various blocks could be developed to use the data. Feel free to take the code from this component to improve the core.
In your PostNuke admin system go to the WebLinks section and use the Add new link feature.
Add a new link considering the following:
The link title will be used as the link title in the map marker pop up.
The link url will be used as the link url in the map marker pop up. If the supplied link is less than 7 characters (http://) the text will be the title rendered in the map marker pop up without being a link. This is necessary since the web links modules defaults to http:// in the input form and does not allow for empty links. When creating multiple links with invalid links you have to use unique strings (e.g. just use a number), otherwise the weblinks module will not allow you to create the link with an identical link url as another one.
The coordinates for the map marker will be established from the substring {ll=longitude,latitude} within the link description. The easiest way to obtain the coordinates for a specific location is to navigate to the location at http://maps.google.com, click “Link to this page” and copy the ll=x,y section from the browser url window. Insert this string into description and surround it with {}. See the links section at http://www.mosabuam.com/index.php?name=Web_Links&req=viewlink&cid=24 for examples.
By default all links that contain the string “{ll=” in the description will be evaluated to be put onto the map. It is also possible to create a map per web links category. To display only the markers in this category on the map use weblinksmap.php?catid=x with x being the id for your category (which you can find out by looking at the url when you navigate to your web links category).
For questions visit http://www.mosabuam.com or contact manfred@mosabuam.com
manfred
April 24th, 2006 at 16:04
I announced the release on Postnuke.com
manfred
April 24th, 2006 at 16:04
I announced the release on Postnuke.com