Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

Adding locations to the ContextHub dropdown

Avatar

Level 3

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.

contextHub.PNG

1 Accepted Solution

Avatar

Correct answer by
Administrator

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

View solution in original post

3 Replies

Avatar

Administrator

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

Avatar

Level 3

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

Avatar

Correct answer by
Administrator

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