Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 15    Views: 77

Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
07/09/14 12:47 PM (10 years ago)

Missing navBarTitleText: in my plugin?

When I create a screen in the Control Panel using any other plugin I get correct JSON: { "itemId": "3FEFBF6BC468340D3112771", "itemType": "RD_simpleSound", "itemNickname": "sound", "navBarTitleText": "sound" } When I create a screen in the Control Panel using my new plugin I get missing JSON: { "itemId": "4E00F3C9092C11992985786", "itemType": "RD_simpleDraw", "itemNickname": "Draw" } Notice the "navBarTitleText": "Draw" is missing. This happens on BT.com and self hosted so it must be something wrong in my plugin code but I just can't find it. Can anyone tell me what might be causing this? Thank you.
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
07/09/14 12:50 PM (10 years ago)
I wrote in the other post. have you tried this? Red, I believe it doesn't work properly because you didn't import any of the BT files in the RD_simpleDraw.m file. #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #import "JSON.h" #import "BT_application.h" #import "BT_strings.h" #import "BT_viewUtilities.h" #import "BT_appDelegate.h" #import "BT_item.h" #import "BT_debugger.h" Thus, the json and normal functions don't interact with the plugin.
 
Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
like
07/09/14 01:04 PM (10 years ago)
Thanks, but I added them last night and it did not make any difference. I did not have them in my code that worked in my demo vid either. :-(
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
07/09/14 01:05 PM (10 years ago)
Dont think its this but you never know.maybe you deleted it accidently in the cp_config file
 
Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
like
07/09/14 01:10 PM (10 years ago)
I thought maybe I was missing the _navBar.html line too, but no. Here is my config_cp.txt: {"propertySections":[ {"fileType":"bt_section", "fileName":"btSection_navBar.html"}, {"fileType":"bt_section", "fileName":"btSection_login.html"}, {"fileType":"bt_section", "fileName":"btSection_backgroundColor.html"}, {"fileType":"bt_section", "fileName":"btSection_backgroundImage.html"}, {"fileType":"bt_section", "fileName":"btSection_search.html"}, {"fileType":"bt_section", "fileName":"btSection_tabBar.html"}, {"fileType":"bt_section", "fileName":"btSection_screenJson.html"} ] }
 
Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
like
07/09/14 01:33 PM (10 years ago)
When you create a new screen in the Control Panel, the screen "nickname" is populated into the plugin's Top Navigation Bar "Bar Title" field. BT will no longer do that with my plugin. The field is blank so I get bad JSON. I can fill in the "Bar Title" manually and then JSON is perfect. I just can't figure out why the CP will not auto-populate this field in my plugin.
 
Cakebit
Code is Art
Profile
Posts: 501
Reg: Dec 15, 2010
In your local b...
16,510
like
07/09/14 02:02 PM (10 years ago)
@Red Dog, Would it be that you don't have the opening bracket { in your config.txt? It reads: //default json data defaultJSONData: "itemType":"RD_simpleDraw", "itemNickname":"HOME", "navBarTitleText":"HOME", "backgroundImageNameLargeDevice":"horse.jpg", "backgroundImageScale":"fullScreen"} Instead of: //default json data defaultJSONData: {"itemType":"RD_simpleDraw", "itemNickname":"HOME", "navBarTitleText":"HOME", "backgroundImageNameLargeDevice":"horse.jpg", "backgroundImageScale":"fullScreen"}
 
Cakebit
Code is Art
Profile
Posts: 501
Reg: Dec 15, 2010
In your local b...
16,510
like
07/09/14 02:09 PM (10 years ago)
I just tested it out! The problem was in the config.txt file (as posted above). Just make sure to have valid JSON in your defaultJSONData. This code works fine! {"itemType":"RD_simpleDraw", "itemNickname":"", "navBarTitleText":"", "backgroundImageNameLargeDevice":"", "backgroundImageScale":"fullScreen"} Just note that opening bracket at the begging of the JSON ;) Self Hosted users may need to re-install the plugin - I just don't know! Cheers, -Cake P.S. FYI: You probably don't want to pre-fill the JSON values. If you DO pre-fill them, the server won't overwrite them when creating your screen. So instead of this: "navBarTitleText":"HOME" Use This: "navBarTitleText":""
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
07/09/14 02:23 PM (10 years ago)
Yeaaaaa cakebit! I had prefilled values in my installation lol.. Random and the start bracket was missing. Thanks
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
07/09/14 02:24 PM (10 years ago)
cool nice one cakebit!
 
Cakebit
Code is Art
Profile
Posts: 501
Reg: Dec 15, 2010
In your local b...
16,510
like
07/09/14 02:28 PM (10 years ago)
@mysps, I forgot to say: The only time you really need to pre-fill the values is if you want a default value. For example, I might want: "titleTextSize":"20" to be the default value, but if I don't I'll just use "titleTextSize":"". *The user can always overwrite the default value.
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
07/09/14 02:42 PM (10 years ago)
Cool! I rarely use the control panel but when testing a new plugin I do. I saw the horse.png image and laughed hehe
 
Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
like
07/09/14 03:19 PM (10 years ago)
CakeBit ROCKS! Where are you? I owe you a beer (or something).
 
Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
like
07/09/14 03:23 PM (10 years ago)
.... one curly brace can mess up your entire day!
 
Cakebit
Code is Art
Profile
Posts: 501
Reg: Dec 15, 2010
In your local b...
16,510
like
07/09/14 03:28 PM (10 years ago)
Hey Red Dog! I see you are in the So-Cal area! I used to live there! I'm now up in Northern California... if you ever get up here, we'll have to meet up! Cheers! -Cake
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
07/09/14 10:23 PM (10 years ago)
What a great forum post. This makes my day. Great sleuthing, CakeBit!
 

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.