Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 2    Views: 40

PaddyO
Lost but trying
Profile
Posts: 189
Reg: Sep 11, 2013
Geelong
5,190
05/18/14 11:00 PM (10 years ago)

Customising BT_config.txt with another JSON parameter (can I?)

Hi all, At the risk of breaking my BT_config.txt file, I want to use it as a reference point so that a method file can run a conditional "if the value of myNewParameter in the config file is xxxx, then do something". Effectively what I'm doing is inserting a new parameter into the JSON for that plugin... is this doable? For example, config.txt currently says this: "itemId":"267BA7691F6697952A9267D", "itemType":"WB_screen_menuImage", "itemNickname":"listView", "navBarTitleText":"Explore", etc. and I want to add another parameter in there, like so: "itemId":"267BA7691F6697952A9267D", "itemType":"WB_screen_menuImage", "itemNickname":"listView", "navBarTitleText":"Explore", "myNewParameter":"xxxx", etc. Is there some other referencing code that's automatically written deep in the BT backend when I publish it which means I can't jump in and add new stuff like that? Will I kill it? Nervously, Paddy.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
05/19/14 01:04 AM (10 years ago)
If it's for a 'particular' plugin, you can massage the control panel (in self hosted only) html documents to add another parameter if you want... When you do (and if it's done right), it will automatically be included in the json for that screen with no objections from anyone... the thing is, 'no one will know it is there' so be sure to 'connect' the value when it gets to the plugin... I wrote a document that, while not explicitly written for your situation, should give you some needed hints on what goes where... https://www.buzztouch.com/files/howtos/CP2Project.pdf Once you're in your plugin, you just use the 'objectForKey' parameter of your screen jsonVars property and take it from there... Cheers! -- Smug
 
PaddyO
Lost but trying
Profile
Posts: 189
Reg: Sep 11, 2013
Geelong
5,190
like
05/19/14 04:06 PM (10 years ago)
Smug that's as handy as a small saucepan - thank you!! Lots of great insights there. When do you get time to do other stuff, you know, like sleep, eat....? Cheers Paddy.
 

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.