Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 23    Views: 48

FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
11/12/14 03:18 AM (9 years ago)

External child items

hi guys, im trying to use smugs location menu, i know its bit tricky but can someone give me basic guide to external child items, how to write and host them, ive looked online and you tube, but cant find anything, cheers sean
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
11/12/14 04:32 AM (9 years ago)
Hi guys, ive got as far as getting the smug location map on the device, i know i have lots of fiddling to do, but i used the test child item, to see how it works, got it all set up and i can see how it works, got small query, when you launch the screen, ive managed to change the values and see how it works, but when you press the icon to get directions, its saying missing plugin, when i replace the item id with the location map(normal) id it works, but im missing something, can anyone point me, thanks ] sean
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
11/12/14 11:06 PM (9 years ago)
Here's the readers digest version: External ChildItems are just like 'internal' childItems, only held in a separate file, and usually called by a DataURL or included in the app bundle. creating an external childItem file can be done in various ways, but remember there is no 'one' way that will work with 'all' childItem files. ChildItems for a menu are different than ChildItems for a Map, so each will have their own particular 'format' for childItems. This format will be the same as 'internal' child items. 1) gather the 'fields' needed for a valid childItem for the plugin you want to use. 2) create a childItem file either by PHP/MySql, or by using the BT Friendly JSON converter located here: http://www.smugwimp.com/btMods/sjcon.zip you can copy/paste csv data into this and it will convert it into a BT Friendly JSON childItem file. Hope this helps! Cheers! -- Smug
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
11/13/14 12:55 AM (9 years ago)
One other thing I forgot to mention. The package released by Susan Metoxen and I, "WB_addons", is almost the perfect choice for populating the Smug Location Menu or Offline Map. If you have a self hosted setup, you owe it to yourself and your app to install the WB addons. You can either run your app online, or you can also make queries to generate a childItem file that can be saved and bundled with the app. I created a video tutorial on installing and using it here: https://www.youtube.com/watch?v=7s2h9x30loc If you need sample data to play with, you can nab one of the free csv files from Brian Dunning: http://www.briandunning.com/sample-data/ you can get the latest copy of WB_addons at http://www.smugwimp.com/btMods/wb_addons.zip if you want to snoop around what's there, go to http://www.smugwimp.com/btMods/ It's unorganized and chaotic, just like me. Cheers! -- Smug
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
11/13/14 01:20 AM (9 years ago)
thanks bunch smug,already got your json add on installed on my self serve, will get these others installed today, got your map plugin up and running a page within the app, just need to play and tweak, hopefully the above will point me to what i need, thanks smug sean
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
11/15/14 03:58 AM (9 years ago)
Hi dude, got it all set up, thanks to your video, in about hald hour, again thanks dude, you make it all sound easy ( lol ) got it working in the map screen, but cant seam to get it working in your location map plugin, could you possibly explain what to change in the plugin screen. many thanks dude, sean
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
11/15/14 04:02 AM (9 years ago)
Ive got the location menu as far as its showing the rows and miles away button, but not any of the data from the csv file, it shows the data from the csv file if i use the ordinary location menu but not in the location menu plugin, what am i doing wrong dude sean
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
11/15/14 05:18 AM (9 years ago)
How are you getting your data? From a database, or an external CSV file? Cheers! -- Smug
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
11/15/14 05:21 AM (9 years ago)
external csv file as you explained in the video, followed everything you said, it all works when i use the normal location map, just not getting anything in location menu. thanks sean
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
11/15/14 05:22 AM (9 years ago)
ive got team viewer if that helps
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
11/15/14 07:15 AM (9 years ago)
Send me a copy of the childItems. smugwimp at smugwimp.com Cheers! -- Smug
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
11/15/14 07:47 AM (9 years ago)
done :)
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
11/15/14 03:15 PM (9 years ago)
Sean, keep in mind that the utility uses the first line as the json 'key'. Therefore it is imperative that you remove the first line, with periods and commas. The actual 'first line' should be your field names: id, guid, appGuid.... etcetera Cheers! -- Smug
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
11/16/14 03:03 AM (9 years ago)
My csv file looks like this dude, https://www.dropbox.com/s/kg7fzx7tu2egchd/smug.jpg?dl=0 which line do i remove, i thought you said in the video to have line with just dots at the start :)
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
11/16/14 03:54 AM (9 years ago)
right ive taken the first line out, the one with the dots, im still bit confused as to what i put where, im presuming you replace the screen data url, in menu location, with the location of the .txt file, which is the converted to jason (with smugs tool) csv file, ive tried replacing the data url with both the .txt file and the url found in the map tool (this screen comes back with
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
11/16/14 04:17 AM (9 years ago)
double checked everything, and the only plugin it works on is location map, what ive noticed is theres no driving instructions, ive checked and all the lat/long are there, my new csv https://www.dropbox.com/s/zixzet66vi975z1/knightresidence.csv?dl=0
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
11/16/14 08:42 AM (9 years ago)
ive looked at the sample code you sent me first time dude and the code that the csv file has and there completely diff,the first sample code, which works on the menu location is { "childItems": [ { "itemId": 1, "itemType": "Sw_loc_detail", "itemNickname": "The Knight Residence", "iconName": "a.png", "titleText": "The Knight Residence", "descriptionText": "Lauriston StreetEdinburgh", "latitude": 55.945459, "longitude": -3.201603, "categoryText": "accomadation", "subcategoryText": "Serviced Apartments", "loadScreenObject": { "itemId": "02186", "itemType": "BT_screen_map", "itemNickname": "Serviced Apartments", "navBarTitleText": "The Knight Residence", "singleLocationDefaultZoom": "15", "defaultMapType": "hybrid", "childItems": [ { "itemId": "83EABCB56DE7AEBCC3E63AC", "itemType": "BT_mapLocation", "latitude": "53.763696", "longitude": "-3.029512", "title": "My Location", "subTitle": "My Location Subtitle", "pinColor": "red", "transitionType": "fade", "loadScreenWithItemId": "BE0C5F23CF2BE02E4CD5CD6" }, { "itemId": "A5906684B33124AC6C6AB02", "itemType": "BT_mapLocation", "latitude": "55.945459", "longitude": "-3.201603", "title": "My other location", "subTitle": "my other location subtitle", "pinColor": "green", "loadScreenWithItemId": "showDirections" } ] } }, the csv file shows { "childItems": [ { "id": "", "guid": "fm0001", "appGuid": "EA1313EA39E38E70F48E56124", "screenGuid": "", "locationName": "Edinburgh Castle", "address1": "Castlehill", "address2": "", "city": "Edinburgh", "state": "", "postalCode": "", "country": "UK", "latitude": "55.948797", "longitude": "-3.195641", "phone": "0131 225 9846", "email": "", "website": "www.edinburghcastle.gov.uk", "type": "", "category": "City Centre", "status": "", "dateStampUTC": "", "modifiedUTC": "" }, does that mean i have to populate new csv file with the values that are in the first example Cheers sean
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
11/16/14 09:51 AM (9 years ago)
If I didn't mention that I'm sorry, but what's happening is you need to 'transpose' the fieldnames to fit the criteria of the plugin. So the short answer is 'yes'. But what you can do is just make a copy of the csv file and change the field names in that to meet the plugin. Cheers! -- Smug
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
11/16/14 10:52 AM (9 years ago)
so what i do is create another csv file with field names itemId-itemType-itemNickname-iconName-titleText-descriptionText-latitude-longitude-categoryText-subcategoryText-loadScreenObject do i also just add the sub child items as well, ie "itemId": "02186", "itemId": "83EABCB56DE7AEBCC3E63AC", "itemId": "A5906684B33124AC6C6AB02", { "childItems": [ { "itemId": 1, "itemType": "Sw_loc_detail", "itemNickname": "The Knight Residence", "iconName": "a.png", "titleText": "The Knight Residence", "descriptionText": "Lauriston StreetEdinburgh", "latitude": 55.945459, "longitude": -3.201603, "categoryText": "accomadation", "subcategoryText": "Serviced Apartments", "loadScreenObject": { "itemId": "02186", "itemType": "BT_screen_map", "itemNickname": "Serviced Apartments", "navBarTitleText": "The Knight Residence", "singleLocationDefaultZoom": "15", "defaultMapType": "hybrid", "childItems": [ { "itemId": "83EABCB56DE7AEBCC3E63AC", "itemType": "BT_mapLocation", "latitude": "53.763696", "longitude": "-3.029512", "title": "My Location", "subTitle": "My Location Subtitle", "pinColor": "red", "transitionType": "fade", "loadScreenWithItemId": "BE0C5F23CF2BE02E4CD5CD6" }, { "itemId": "A5906684B33124AC6C6AB02", "itemType": "BT_mapLocation", "latitude": "55.945459", "longitude": "-3.201603", "title": "My other location", "subTitle": "my other location subtitle", "pinColor": "green", "loadScreenWithItemId": "showDirections" } ] } }, i then input all the place information individually :( lol and follow your direction in the video , is that right dude thanks sean
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
11/16/14 11:45 PM (9 years ago)
Testing it is the best way to be sure. It can work with CSV files, but for the end json you might need to do a bit of cut/paste to get everything 'just right'. MySql is about the same, but you can automate a bunch of tasks to make it all automated. Anyway, try it and see. that's the easiest way to see if it works ;) Cheers! -- Smug By the way, I'm not sure if "loadScreenWithItemId": "showDirections" is going to work for you. The recent versions of BT_screen_map use the json key 'callOutTapChoice' to determine if it's going to load another BT screen, or use external driving directions. "callOutTapChoice": "showDirections" is the correct key/value pair for external directions. for 'loadNextScreen' you would need to populate either loadScreenWithItemId, loadScreenByNickname, or loadScreenObject.
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
11/17/14 01:06 AM (9 years ago)
bump
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
11/17/14 02:43 AM (9 years ago)
bump
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
11/17/14 02:49 AM (9 years ago)
heres your code that makes the location map work,can you explain what each section is for please dude, im finding this very confusing. cheers dude ie what details do i add for itemid 1 what details do i add for item id 83EABCB56DE7AEBCC3E63AC what details do i add for item id A5906684B33124AC6C6AB02 when i use your supplied code in location map, when i press the location, i get missing plugin on both locations, { "childItems": [ { "itemId": 1, "itemType": "Sw_loc_detail", "itemNickname": "Antonio B. Won Pat International Airport", "iconName": "icn_airplane.png", "titleText": "Antonio B. Won Pat International Airport", "descriptionText": "Route 10A", "latitude": 13.49241, "longitude": 144.80502, "categoryText": "Airport", "subcategoryText": "Airport", "loadScreenObject": { "itemId": "02186", "itemType": "BT_screen_map", "itemNickname": "Airport", "navBarTitleText": "Antonio B Won Pat Airport", "singleLocationDefaultZoom": "15", "defaultMapType": "hybrid", "childItems": [ { "itemId": "83EABCB56DE7AEBCC3E63AC", "itemType": "BT_mapLocation", "latitude": "13.5", "longitude": "144.8", "title": "My Location", "subTitle": "My Location Subtitle", "pinColor": "red", "transitionType": "fade", "loadScreenWithItemId": "showDirections" }, { "itemId": "A5906684B33124AC6C6AB02", "itemType": "BT_mapLocation", "latitude": "13.52", "longitude": "144.82", "title": "My other location", "subTitle": "my other location subtitle", "pinColor": "green", "loadScreenWithItemId": "0987654321D" } ] } }, { "itemId": 2, "itemType": "Sw_loc_detail", "itemNickname": "Freedom Air - Tiyan", "iconName": "icn_airplane.png", "titleText": "Freedom Air - Tiyan", "descriptionText": "Mariner Avenue", "latitude": 13.47813, "longitude": 144.79597, "categoryText": "Airport", "subcategoryText": "Airline", "loadScreenObject": { "itemId": "02186", "itemType": "BT_screen_map", "itemNickname": "Airport", "navBarTitleText": "Antonio B Won Pat Airport", "singleLocationDefaultZoom": "15", "defaultMapType": "hybrid", "childItems": [ { "itemId": "83EABCB56DE7AEBCC3E63AC", "itemType": "BT_mapLocation", "latitude": "13.5", "longitude": "144.8", "title": "My Location", "subTitle": "My Location Subtitle", "pinColor": "red", "transitionType": "fade", "loadScreenWithItemId": "showDirections" }, { "itemId": "A5906684B33124AC6C6AB02", "itemType": "BT_mapLocation", "latitude": "13.52", "longitude": "144.82", "title": "My other location", "subTitle": "my other location subtitle", "pinColor": "green", "loadScreenWithItemId": "0987654321D" } ] } } ] } basically i just need to know what format child items your location menu needs
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
11/18/14 12:30 AM (9 years ago)
There is a sample childItem set in the readme files. This may also help: http://www.buzztouch.com/docs/v1.5/childItems.php Cheers! -- Smug
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.