Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 8    Views: 74

mishgolf
Aspiring developer
Profile
Posts: 98
Reg: Nov 02, 2012
Sunshine Coast,...
980
11/23/13 01:51 PM (12 years ago)

Favourites Plugin - Want to limit visibility of + button on some pages

hi guys, i have the favourites plugin made by kittsy. awesome plugin. i have added the code to my chosen plugin which is bt_screen_customHTML my trouble is that i dont need the + button at the top right hand side on all of my pages? is there anyway to stop the + button appearing on individual pages? thanks
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
11/23/13 02:27 PM (12 years ago)
The way I understand it, the + symbol will show on all screens made with the chosen plugin. Your one option would probably be to make a copy of the bt_screen_customHTML (or use the html pro plugin) and use one for screens that will have the + and one for those that won't.
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
11/23/13 02:45 PM (12 years ago)
@mutsy is absolutely correct, and his solution is a very smart one. David https://buzztouchmods.com/market
 
EdReyes
Lost but trying
Profile
Posts: 574
Reg: Oct 21, 2013
location unknow...
17,640
like
11/23/13 05:23 PM (12 years ago)
good to know, thanks
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
11/23/13 10:08 PM (12 years ago)
i haven't seen the code for this plugin, but there's certainly a solution without creating duplicate plugins. Assuming it uses the self.navigationItem property to set the button, you can remove it like so: [self.navigationItem setRightBarButtonItem:nil]; And if you want it to be on certain screens for that plugin but not others, you could do something like: if ([[BT_strings getJsonPropertyValue:self.screenData.jsonVars nameOfProperty:@"showPlusButton" defaultValue:@"YES"] isEqualToString:@"NO"]) [self.navigationItem setRightBarButtonItem:nil]; Then, you would just need a control panel property called "showPlusButton" for each of your screens. You can also use if checks against property values, such as checking the itemId for specific screens, etc.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
11/24/13 11:27 AM (11 years ago)
To add onto Chris ... You could also check the JSON "screenNickname" instead of checking for the numerical "itemId". -- Niraj
 
mishgolf
Aspiring developer
Profile
Posts: 98
Reg: Nov 02, 2012
Sunshine Coast,...
980
like
11/26/13 07:56 PM (11 years ago)
Thanks @Mutzy i like your thinking i will give that a go. thanks to all others for commenting.
 
mishgolf
Aspiring developer
Profile
Posts: 98
Reg: Nov 02, 2012
Sunshine Coast,...
980
like
01/16/14 11:32 PM (11 years ago)
hi everyone, if i could ask again your help on this issue. @mutzy i brought the plugin called html pro and tried to use it but its more like a menu plugin and not a custom html page. i am not able to paste code into it and display a page. as far as duplicating the plugin, im not really sure on the full process of doing this, any help would be appreciated. @chris1 @Niraj Shah ideally i would like to paste some code in like you suggested, are you able to tell me where i should be inserting this code? i only have about 5 pages to change. thanks mishgolf
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
01/17/14 07:03 AM (11 years ago)
Put Chris1's code into the viewDidLoad method of that bt_screen_customHTML.m plugin file. Then use the Advanced JSON section at the bottom of the Control Panel for your HTML Screens to insert the property for "showPlusButton" by setting its value to "YES" or "NO". Let us know how you get along. -- Niraj
 

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.