[attachment=355:v.zip] I have set up an "application" in matrix where students can find useful accommodation information. I'd like to share the tip with you guys having my supervisor's approval.
The application allows public user to register accommodation information to our website, then the administrative staff receives notificaiton email, goes to the asset, marking up extra metadata and put it live.
Here are the assets used in this "application" followed by the purpose.
[list=1]
[*]Asset builder: to create new items
[*]Trigger: to send out notification emails; change future status (the information will be archived if no request for continuing posted)
[*]Paintlayout: to print metadata to both HTML and Google Map scripts
[*]metadata schema for news item
[*]asset listing page: list out all accommodation in a table and google map(shown below)
[*]customised layout for simple edit interface (divs within the layout have different permission settings since the news item asset is used elsewhere)
The asset listing page looks like below, of course it prints metadata fileds
[attachment=337:1.jpg]
The news item looks like below.
[attachment=338:2.jpg]
By using conditional keywords, the description for accommodation type is printed depending on the value of the metadata field and the campus location and description.
Last week I found a way to set javascript varibles' value by asset listing page, so all the news item assets could be marked up in a map. Here it is,
[attachment=339:3.jpg]
To do so, in the asset listing page contents, put
//Campus var point = new GLatLng(-22.2222222, 222.2222222); var marker = new GMarker(point); map.addOverlay(createMarker(point, campus, "")); //Accommodation %asset_listing%
And in type formats put
var point = new GLatLng(%asset_metadata_Latitude%, %asset_metadata_Longitude%); var marker = new GMarker(point); map.addOverlay(createMarker(point, accom, "%asset_attribute_name% %asset_metadata_Address% %asset_metadata_Accommodation_Type% Preference: %asset_metadata_Person_Required% %asset_metadata_Weekly_Cost_of_Accom% per week
"));
So the codes to paint the icon(together with metadata fields) for each accommodation will be repeated till the end of the asset listing.
Remember to set "style information: presentation" and "content type" to "raw html" otherwise Matrix will print <div>s which break Javascript.
The method to set up google map can be found at http://code.google.com/apis/maps/documentation/, but I got the trick of "onload" from http://code.google.com/apis/maps/documentation/. Sorry I cannot find that post but I am sure it's in the forum.
:P' /> 3.jpg (78.1 KB) 1.jpg (45.9 KB) 2.jpg (77.7 KB) squiz_conf_google_map_integration_2.pdf (300 KB)