Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 10    Views: 61

SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
02/03/15 11:33 PM (9 years ago)

Duplicating Similar Screen Details...

So I'm working on this app, and it's basically 'quiz' based, therefore I employ Nad's advanced quiz. The beautiful thing about Nad's quiz is that it is so configurable. The problem with Nad's quiz though, is that it's so configurable. And I have about 40 quiz screens. What to do. Well, I've found that I can cheat (on this screen, or any other 'multiple' screen) with only a small edit or two. 1) Create your 'base' screen. Something that you can use as a template for all other 'similar' screens. Make sure you get ALL your details the way you want them to be. 2) On that Plugin configuration page, scroll down to the section called 'Json Configuration Data (Editable)'. It allows you to directly edit the json data for that plugin. 3) Copy all of the JSON 'below' the 'navBarTitleText' key/value pair (except the bracket). 4) Paste this into a 'new' screen, in the Json Configuration Data (Editable), in the same area (below the 'navBarTitleText' key/value pair) replacing and augmenting the json data (except the bracket). Also, if it's 'new' json you may need to add a comma to the end of the original json, to keep it all compliant. 5) Save. It will save that data and populate all those choices, without having to do it all one by one repetitively over and over (and over) again. If you're not familiar or comfortable with JSON editing, you may want to pass this by. But if you feel reasonably confident in your cut/paste skills, give it a whirl. It's saving me hours. Cheers! -- Smug
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
02/03/15 11:56 PM (9 years ago)
Thanks, Smug! Great tip!
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
02/04/15 01:18 AM (9 years ago)
So simple yet so effective.
 
nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
like
02/04/15 02:44 AM (9 years ago)
Thumbs up!
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
02/04/15 05:18 AM (9 years ago)
Hey Smug, there used to be a bug in the CP code. Can you check to see if it was solved by David Book? On any of the new screens, after you inserted that JSON, edit one of those fields via the GUI (not via the JSON). Then save it. Does everything look okay, in the fields and in the JSON? It should all be just fine, no bug to be evident yet. Now add a custom JSON entry. Save it. Make a change to another field. Save it. Did your custom JSON vanish? --- that be the critter named Bug! I reported it to David a few months ago, not sure if he has fixed it yet. May not even be fixable.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/04/15 06:28 AM (9 years ago)
No, everything seems to work for me, or at least, within Nad's quiz, which was the plugin I was working on. I had about 40 screens, most of which have properties that are the same and do not change. I did my first screen the way I wanted it to be, and after creating new screens for each of the other quizzes, I cut out of the first one, and pasted into the second one. I randomly checked for a few values, found them to be present, and went on to do the rest of the screens. Easy Peasy. I needed to add a comma to the last json statement of original data, paste the new values, and change the filename of the local childItem file, and that was about it. Took an hours long project and turned into about 30 minutes of work. Cheers! -- Smug
 
Arubaman
Aspiring developer
Profile
Posts: 636
Reg: Oct 20, 2011
Akron
16,910
like
02/04/15 10:57 AM (9 years ago)
Nice tip, thanks.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
02/04/15 04:26 PM (9 years ago)
Niraj, what you described is a feature that does still exist. It happens when you add json by hand that is *not* one of the plugins control panel entries. The extra json is lost when you save via the control panel, because the plugins control panel doesn't know that extra json exists. To overcome this, I suggest we would need an extra entry in a plugins control panel for 'Custom JSON', which could save the extra data. One for David maybe?
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
02/04/15 08:20 PM (9 years ago)
Smug - Thanks for the detailed tip! Now to save it, and remember it ;) AlanMac - great idea. I have some custom JSON that I always have to remember to add back in after changing a plugin value. Definitely something I hope can be added to David's list.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
02/05/15 12:32 AM (9 years ago)
Hi gang, I've heard of this a few times and forgive me, but never witnessed it. It could be painfully easy to duplicate, I just haven't given it a go recently. I do know that long ago, BEFORE the raw-json data showed on each screen (allowing custom values) it was added to the Theme. In other words, I added a generic box to the app's theme allowing any old value to be entered. This was then available to the app by referencing the theme-data. This may or may not be useful anymore? But, it's still there and works well given the proper circumstance. On to the issue at hand. This shouldn't take too long to confirm / identify / and hopefull fix (unlike so many other lingering gotcha's)....Can somebody email me... a) The name of an app in their control panel I can tinker with. Assuming BT hosted here, not self hosted (althought the issue could exist on both) b) The nickname of a screen in their app where this is happening (it could be any screen I just to be sure) c) The email address associated with the app owners BT account, if it's different than the email from address. I have a fresh cup of coffee, I"m pissed at the world tonight, and would love nothing more than to find a quick, fun, useful fix for something. LOL d.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
02/05/15 05:39 AM (9 years ago)
Hi David, it's easier to describe a simple way of how to recreate the problem for yourself by the following steps instead of providing access. I first discovered this feature when I was thinking about setting the default menu row properties across my app, by adding custom json to the themes plugin. Here are the steps: 1) Copy some json from the menu plugin - e.g. "listRowBackgroundColor": "#000066", 2) Paste this json into the theme plugin 3) Save 4) Edit Navigation Bar entry (or anything else), E.G. change the Navigation Bar style and save. 5) Look at the json and you will see that the json that was manually pasted in has gone. That is all there is to it. The save over-writes any custom additions. It's like this everywhere. Imho, the simple (but beyond me) solution is to provide a second json entry field for the custom json. The save would concatenate the two. What do you think?
 

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.