Adding locations to the ContextHub dropdown | Community
Skip to main content
Level 3
June 30, 2017
Solved

Adding locations to the ContextHub dropdown

  • June 30, 2017
  • 3 replies
  • 1521 views

Is there a way of adding locations to the contexthub drop down?  For a demo I have temporarily modified /libs/granite/contexthub/components/modules/location/clientlib/renderer.location.js to add a couple of locations in the predefinedLocations array.  However, I would like to have a more suitable solution that does not require making changes to /lib files.

I simply want to add a few more cities that are more local for demonstration purposes.  Any suggestions greatly appreciated.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by kautuk_sahni

Yes, you are correct here that we can not overlay clientlibs (Apologizes for that).

But what is happening here is :-

If you are using same category on more then one folder and also using this category name :-

/apps/example/clientlibs[categories="hola"]

/libs/example/clientlibs[categories="hola"]

Then it means that all clientlibs which has this category(for ex:-hola) will be loaded and it just gets stacked onto it.

You can just extending the clientlib, and this is performed just putting in your clientlib the same categories of foundation clientlib.

~kautuk

3 replies

kautuk_sahni
Community Manager
Community Manager
June 30, 2017

You can extend /libs/granite/contexthub/components/modules/location/clientlib/renderer.location.js file in the apps folder (create a same hierarchy under Apps folder).

Note:- This is edited after Iain's repy. Overlay word is changed to extend.

~kautuk

Kautuk Sahni
Level 3
June 30, 2017

Thanks - I didn't think you could overlay clientlibs - However I have just tried this and it worked.

kautuk_sahni
Community Manager
kautuk_sahniCommunity ManagerAccepted solution
Community Manager
July 3, 2017

Yes, you are correct here that we can not overlay clientlibs (Apologizes for that).

But what is happening here is :-

If you are using same category on more then one folder and also using this category name :-

/apps/example/clientlibs[categories="hola"]

/libs/example/clientlibs[categories="hola"]

Then it means that all clientlibs which has this category(for ex:-hola) will be loaded and it just gets stacked onto it.

You can just extending the clientlib, and this is performed just putting in your clientlib the same categories of foundation clientlib.

~kautuk

Kautuk Sahni