[GeoNetwork-users] geonetwork 3.0.1 user interface customization

Dear list,

I have a couple of pretty simple questions on customizing the user interface
in Geonetwork 3.0.1. I have tried to read documentation and search over the
internet but all information I've found seems to be outdated. Perhaps the
answers to my questions are being added in the documentation already, but
here goes...

1) How to disable other languages than English. Commenting out language tags
in config-gui.xml doesn't seem to be enough. I still get options of six
different languages in the selector at the upper right corner.

2) Which files in geonetwork installation should I look to customize the
"home" page (or how is it called:
...geonetwork/srv/eng/catalog.search#/home), where it reads by default "Here
you will find data, services and maps and more." I want to add more text
there and some images.

3) Changing catalog logo in the top banner is very easy with the Admin
console, but is it possible to add additional logos (of donor
organizations). It would be very nice if a link could be added also, so when
a user clicks the logo it redirects the user to the donor's website.

4) Also at the "home" page there is a possibility to Browse by topics (radio
button). How can I add more browse options, lets say browse by categories?

Many thanks for your help. I really like the new look of Geonetwork 3, such
a huge improvement!

Pekka

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/geonetwork-3-0-1-user-interface-customization-tp5219659.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

Hi,

If you want to customize the ui, you will need to change the code a bit. If
you do so, you may have issues to port your changes to newer version (but
maybe not). 3 ways to update the code:
1. change the default view code
2. create a new view in web-ui/src/main/resources/catalog/views
3. create a new view in a new maven project (following intructions :

)

For 2. and 3., you will create a new view (you can define your whole new
ui, and use default ui component as well). To view it, you will need to add
a url parameter to your page : /catalog.search?*view=myview*#/search
Or, to apply this view by default, you can set a settings in admin console
page (default ui view or something like that).

For your needs :

1) How to disable other languages than English. Commenting out language tags

in config-gui.xml doesn't seem to be enough. I still get options of six
different languages in the selector at the upper right corner.

Change those lines :
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/js/CatController.js#L48
Be sync with $scope.langs and $scope.langLabels.
As the TODO says, it should get the liste from settings, but it's not done
yet.

2) Which files in geonetwork installation should I look to customize the
"home" page (or how is it called:
...geonetwork/srv/eng/catalog.search#/home), where it reads by default
"Here
you will find data, services and maps and more." I want to add more text
there and some images.

The home template is here :
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/views/default/templates/home.html
When you see data-translate, it means the strings are localized.
Check in
https://github.com/geonetwork/core-geonetwork/tree/develop/web-ui/src/main/resources/catalog/locales
to see translations. You can add your own strings.

3) Changing catalog logo in the top banner is very easy with the Admin
console, but is it possible to add additional logos (of donor
organizations). It would be very nice if a link could be added also, so
when
a user clicks the logo it redirects the user to the donor's website.

The template of the toolbar is here
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/templates/top-toolbar.html

4) Also at the "home" page there is a possibility to Browse by topics
(radio
button). How can I add more browse options, lets say browse by categories?

Well you need to write some angular code. You need to edit the home page
template, but also add code to main controller in
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/views/default/module.js.
Maybe try to look on how actual topics browsing works ?

Many thanks for your help. I really like the new look of Geonetwork 3, such
a huge improvement!

Pekk

Good luck !

--
*camptocamp*
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS

*Florent Gravin*
0479444492

Dear Florent,

many thanks for the detailed answer, very helpful. I was a bit afraid I
would have to touch the source code, no easy way out then. I'm not familiar
with that. However I see there is good developer documentation available so
it should not be totally impossible for (almost) non-programmers. Let's
see...

BR,

Pekka

Florent gravin-2 wrote

Hi,

If you want to customize the ui, you will need to change the code a bit.
If
you do so, you may have issues to port your changes to newer version (but
maybe not). 3 ways to update the code:
1. change the default view code
2. create a new view in web-ui/src/main/resources/catalog/views
3. create a new view in a new maven project (following intructions :
https://github.com/geonetwork/core-geonetwork/wiki/Add-your-own-customized-user-interface
)

For 2. and 3., you will create a new view (you can define your whole new
ui, and use default ui component as well). To view it, you will need to
add
a url parameter to your page : /catalog.search?*view=myview*#/search
Or, to apply this view by default, you can set a settings in admin console
page (default ui view or something like that).

For your needs :

1) How to disable other languages than English. Commenting out language
tags

in config-gui.xml doesn't seem to be enough. I still get options of six
different languages in the selector at the upper right corner.

Change those lines :
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/js/CatController.js#L48
Be sync with $scope.langs and $scope.langLabels.
As the TODO says, it should get the liste from settings, but it's not done
yet.

2) Which files in geonetwork installation should I look to customize the
"home" page (or how is it called:
...geonetwork/srv/eng/catalog.search#/home), where it reads by default
"Here
you will find data, services and maps and more." I want to add more text
there and some images.

The home template is here :
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/views/default/templates/home.html
When you see data-translate, it means the strings are localized.
Check in
https://github.com/geonetwork/core-geonetwork/tree/develop/web-ui/src/main/resources/catalog/locales
to see translations. You can add your own strings.

3) Changing catalog logo in the top banner is very easy with the Admin
console, but is it possible to add additional logos (of donor
organizations). It would be very nice if a link could be added also, so
when
a user clicks the logo it redirects the user to the donor's website.

The template of the toolbar is here
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/templates/top-toolbar.html

4) Also at the "home" page there is a possibility to Browse by topics
(radio
button). How can I add more browse options, lets say browse by
categories?

Well you need to write some angular code. You need to edit the home page
template, but also add code to main controller in
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/views/default/module.js.
Maybe try to look on how actual topics browsing works ?

Many thanks for your help. I really like the new look of Geonetwork 3,
such
a huge improvement!

Pekka

Good luck !

--
*camptocamp*
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS

*Florent Gravin*
0479444492
------------------------------------------------------------------------------
_______________________________________________
GeoNetwork-users mailing list

GeoNetwork-users@anonymised.com

https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/geonetwork-3-0-1-user-interface-customization-tp5219659p5219990.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.