Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 9    Views: 76

Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
01/20/13 10:09 AM (13 years ago)

BTM Search Menu Question

Hi I am creating an app with possibly hundreds of screens and I would really like to use the BTM search menu. But the issue I have is many of the screens require using the same title, therefore I am relying on using 2nd line descriptions to make it easier for users to identify the screens. Is there a way to include a second line description to the search list? I hope I have explained my issue right. Any help will be much appreciated.
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
01/20/13 02:14 PM (13 years ago)
Hi Dragon007, I don't have the search plugin but there should be a line like this in your .m file (from the plugin): NSRange r = [[thisItem.jsonVars objectForKey:@"titleText"] rangeOfString:searchBox.text options:NSCaseInsensitiveSearch]; Now change titleText to descriptionText so it looks like this: NSRange r = [[thisItem.jsonVars objectForKey:@"descriptionText"] rangeOfString:searchBox.text options:NSCaseInsensitiveSearch]; I think it should work. Let me know. Best Regards, Danny
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
01/20/13 02:16 PM (13 years ago)
Or better overwrite that whole line with this: NSRange r = [[thisItem.jsonVars objectForKey:@"descriptionText"] rangeOfString:searchBox.text options:(NSCaseInsensitiveSearch|NSDiacriticInsensitiveSearch)]; Hope it helps. Best Regards, Danny
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
01/20/13 03:35 PM (13 years ago)
When I was trying apps from Black White, her search box was finding both the Title and Subtitle text. In her app, she was using Danny's Menu and Blog plugins. Perhaps Danny's plugin has an all-inclusive search? Check out her apps via her profile, try the first or third app. http://www.buzztouch.com/Black%20White -- Niraj
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
01/21/13 09:59 AM (13 years ago)
Thanks guys for your help, will try this out. I have Danny's Menu plugin, not sure if it includes 2nd line description in the search, but I will try both methods. Again thanks Danny for your advice, will let you know how I get on.
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
01/21/13 03:33 PM (13 years ago)
Hi Danny tried adding the code, but it didn't work. Still only shows the title. Was this solution for the BTM Search plugin or your menu with search plugin?
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
01/21/13 03:35 PM (13 years ago)
If I have two types of menu's in my app could this be the reason why its not working. I have the carousel plugin and the menu with image plugin and its the menu with image plugin that has the 2nd line description.
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
01/21/13 04:22 PM (13 years ago)
Hi Dragon, have a look at your json file. Have a look how the second line / description is called and use that for the search. Lets say the second line is called mydescription Try and use mydescription like this: NSRange r = [[thisItem.jsonVars objectForKey:@"mydescription"] rangeOfString:searchBox.text options:(NSCaseInsensitiveSearch|NSDiacriticInsensitiveSearch)]; But...... The search menu was built to use with the default menu from buzztouch (menusimple) I guess. So you can't make this work with the carousel menu or menu with image, out of the box. Have look at the same file for the (itemtype) 'BT_menuItem' and change this to the itemtype of the menu you want to work with (probably menu with image). I'm just guessing since I don't have the plugins (yet, too busy) but it should give you a start. Hope this helps. Best Regards, Danny
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
01/22/13 06:35 AM (13 years ago)
Thanks Danny, any help is welcome. I did think about changing the 'BT_menuItem' to the menu I want to use which would be the 'Menu With Image' but I could see that the 'BT_menuItem' was displayed in so many places in the .m file you asked me to look at and I'm not that great with code and don't to mess the app up. Would I be right in thinking the 'BT_menu...' would need changing in all the places mentioned in the file?
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
01/22/13 01:02 PM (13 years ago)
Hi Dragon, If you want to edit a file, always make a backup of the original one before editing. There should be a couple of itemtypes that needs to be set to the itemtype of the menu with images. Hard to explain (at least for me) what should change and what should be left untouched. I love to help you out and you can send your xcode project to info##@bt-addons ##.com (ofcourse withought hashtags). Since I'm working with an older version of xcode I don't know if I can open it. Besides this I'm extremely busy at the moment cause my server got hacked 2 days ago ( a lot of websites are compromised). A lot of cleaning up, repairing is neccessary. That's the reason why I can't tell when I can have a look at it (but sometimes I have to wait some time and I could use those moments to have a look at your app). Let me know. Best Regards, Danny
 

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.