[GeoNetwork-users] set default browse mode

Hi all,

in GN3.2 I would like to modify a bit the home page.
I have already added categories to the radio button
related to 'Browse by'. I would like to change the default
position of the radio button.
I say in module.js some lines related to this aspect,
but I don't understand how to change the code to
have the wanted effect.

Could you give me an hint?

Best

Eugenio

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoNetwork-users-f3860293.html

Hi

The html code to display the radio buttons for browse by topic categories
and inspire themes is the following:

https://github.com/geonetwork/core-geonetwork/blob/3.2.x/web-ui/src/main/resources/catalog/views/default/templates/home.html#L37

Not sure what change you require. If it's just the order of the radio
buttons, you can check to update that snippet (see input type="radio" elements
to reorder them) or if you need to move the full section to other page
location, I guess can be copied all related code that handles that section
to a new location, but requires to be tested.

Regards,
Jose García

On Wed, Jul 11, 2018 at 9:35 AM, frippe12573 <frippe12573@anonymised.com>
wrote:

Hi all,

in GN3.2 I would like to modify a bit the home page.
I have already added categories to the radio button
related to 'Browse by'. I would like to change the default
position of the radio button.
I say in module.js some lines related to this aspect,
but I don't understand how to change the code to
have the wanted effect.

Could you give me an hint?

Best

Eugenio

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoNetwork-users-
f3860293.html

------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/
projects/geonetwork

--

*Vriendelijke groeten / Kind regards,Jose García
<http://www.geocat.net/&gt;Veenderweg 136721 WD BennekomThe NetherlandsT: +31
(0)318 416664 <+31318416664> <https://www.facebook.com/geocatbv&gt;
<https://twitter.com/geocat_bv&gt;
<https://plus.google.com/u/1/+GeocatNetbv/posts&gt;Please consider the
environment before printing this email.*

Dear Josè and all,

I have already tried to change the order of the radio buttons,

but it doesn't change the default radio button.

I tested also to change the content of the ['facet name'] putting the categories in the first radio button,

but nothing changed.

I didn't want to move the section in another place, just put categories (I mean the GN categories, not the topic categories) as default.

Any other input is very appreciated.

Eugenio

________________________________
Da: Jose Garcia <jose.garcia@anonymised.com>
Inviato: mercoledì 11 luglio 2018 12:13
A: frippe12573
Cc: Geonetwork-Users@anonymised.com
Oggetto: Re: [GeoNetwork-users] set default browse mode

Hi

The html code to display the radio buttons for browse by topic categories and inspire themes is the following:

https://github.com/geonetwork/core-geonetwork/blob/3.2.x/web-ui/src/main/resources/catalog/views/default/templates/home.html#L37

Not sure what change you require. If it's just the order of the radio buttons, you can check to update that snippet (see input type="radio" elements to reorder them) or if you need to move the full section to other page location, I guess can be copied all related code that handles that section to a new location, but requires to be tested.

Regards,
Jose García

On Wed, Jul 11, 2018 at 9:35 AM, frippe12573 <frippe12573@anonymised.com<mailto:frippe12573@anonymised.com>> wrote:
Hi all,

in GN3.2 I would like to modify a bit the home page.
I have already added categories to the radio button
related to 'Browse by'. I would like to change the default
position of the radio button.
I say in module.js some lines related to this aspect,
but I don't understand how to change the code to
have the wanted effect.

Could you give me an hint?

Best

Eugenio

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoNetwork-users-f3860293.html

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net<mailto:GeoNetwork-users@anonymised.comforge.net>
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

--
Vriendelijke groeten / Kind regards,

Jose García

[https://www.geocat.net/wp-content/uploads/2015/07/GeoCat_small1.png\]<http://www.geocat.net/&gt;
Veenderweg 13
6721 WD Bennekom
The Netherlands
T: +31 (0)318 416664<tel:+31318416664>

[https://www.geocat.net/wp-content/uploads/2015/07/facebook_24.png\]<https://www.facebook.com/geocatbv&gt; [https://www.geocat.net/wp-content/uploads/2015/07/Twitter_icon.png\] <https://twitter.com/geocat_bv&gt; [https://www.geocat.net/wp-content/uploads/2015/07/Google-plus-icon.png\] <https://plus.google.com/u/1/+GeocatNetbv/posts&gt;

Please consider the environment before printing this email.

Hi Eugenio

Sorry, I misunderstood your requirement. The related code is this:
https://github.com/geonetwork/core-geonetwork/blob/3.2.x/web-ui/src/main/
resources/catalog/views/default/module.js#L209-L219

I think this change should work

      // Set the default browse mode for the home page
      $scope.$watch('searchInfo', function (n, o) {
        if (angular.isDefined($scope.searchInfo.facet)) {
          if ($scope.searchInfo.facet['categories'].length > 0) {
            $scope.browse = 'cat';
          } else if ($scope.searchInfo.facet['inspireThemes'].length > 0) {
            $scope.browse = 'inspire';
          } else if ($scope.searchInfo.facet['topicCats'].length > 0) {
            $scope.browse = 'topics';
          } else {
             // If no match set default to categories
             $scope.browse = 'cat';
          }
        }
      });

Assuming in home.html you have something like this for the categories.

<label data-ng-show="searchInfo.facet['categories'].length > 0">
          <input type="radio" name="browse" value="cat"
data-ng-model="browse"/>
          <span data-translate="">categories</span>
        </label>

Make sure to clean your browser cache and also the wro4j cache.

Regards,
Jose García

On Wed, Jul 11, 2018 at 12:21 PM, Eugenio Trumpy <frippe12573@anonymised.com>
wrote:

Dear Josè and all,

I have already tried to change the order of the radio buttons,

but it doesn't change the default radio button.

I tested also to change the content of the ['facet name'] putting the
categories in the first radio button,

but nothing changed.

I didn't want to move the section in another place, just put categories (I
mean the GN categories, not the topic categories) as default.

Any other input is very appreciated.

Eugenio

------------------------------
*Da:* Jose Garcia <jose.garcia@anonymised.com>
*Inviato:* mercoledì 11 luglio 2018 12:13
*A:* frippe12573
*Cc:* Geonetwork-Users@anonymised.com
*Oggetto:* Re: [GeoNetwork-users] set default browse mode

Hi

The html code to display the radio buttons for browse by topic categories
and inspire themes is the following:

https://github.com/geonetwork/core-geonetwork/blob/3.2.x/web
-ui/src/main/resources/catalog/views/default/templates/home.html#L37

Not sure what change you require. If it's just the order of the radio
buttons, you can check to update that snippet (see input type="radio" elements
to reorder them) or if you need to move the full section to other page
location, I guess can be copied all related code that handles that section
to a new location, but requires to be tested.

Regards,
Jose García

On Wed, Jul 11, 2018 at 9:35 AM, frippe12573 <frippe12573@anonymised.com>
wrote:

Hi all,

in GN3.2 I would like to modify a bit the home page.
I have already added categories to the radio button
related to 'Browse by'. I would like to change the default
position of the radio button.
I say in module.js some lines related to this aspect,
but I don't understand how to change the code to
have the wanted effect.

Could you give me an hint?

Best

Eugenio

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoNetwork-users-f386029
3.html

------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/project
s/geonetwork

--

* Vriendelijke groeten / Kind regards, Jose García
<http://www.geocat.net/&gt; Veenderweg 13
<https://maps.google.com/?q=Veenderweg+13+ +6721+WD+Bennekom+ +The+Netherlands&entry=gmail&source=g&gt;
6721 WD Bennekom
<https://maps.google.com/?q=Veenderweg+13+ +6721+WD+Bennekom+ +The+Netherlands&entry=gmail&source=g&gt;
The Netherlands
<https://maps.google.com/?q=Veenderweg+13+ +6721+WD+Bennekom+ +The+Netherlands&entry=gmail&source=g&gt;
T: +31 (0)318 416664 <+31318416664> <https://www.facebook.com/geocatbv&gt;
<https://twitter.com/geocat_bv&gt;
<https://plus.google.com/u/1/+GeocatNetbv/posts&gt; Please consider the
environment before printing this email. *

--

*Vriendelijke groeten / Kind regards,Jose García
<http://www.geocat.net/&gt;Veenderweg 136721 WD BennekomThe NetherlandsT: +31
(0)318 416664 <+31318416664> <https://www.facebook.com/geocatbv&gt;
<https://twitter.com/geocat_bv&gt;
<https://plus.google.com/u/1/+GeocatNetbv/posts&gt;Please consider the
environment before printing this email.*

Thank you Jose it works!

Actually in my module.js I was missing this part:

} else {
             // If no match set default to categories
             $scope.browse = 'categories';
          }

Thanks again

________________________________
Da: Jose Garcia <jose.garcia@anonymised.com>
Inviato: mercoledì 11 luglio 2018 12:36
A: Eugenio Trumpy
Cc: Geonetwork-Users@anonymised.com
Oggetto: Re: [GeoNetwork-users] set default browse mode

Hi Eugenio

Sorry, I misunderstood your requirement. The related code is this: https://github.com/geonetwork/core-geonetwork/blob/3.2.x/web-ui/src/main/resources/catalog/views/default/module.js#L209-L219
[https://avatars3.githubusercontent.com/u/1842442?s=400&v=4]<https://github.com/geonetwork/core-geonetwork/blob/3.2.x/web-ui/src/main/resources/catalog/views/default/module.js#L209-L219&gt;

geonetwork/core-geonetwork<https://github.com/geonetwork/core-geonetwork/blob/3.2.x/web-ui/src/main/resources/catalog/views/default/module.js#L209-L219&gt;
github.com
core-geonetwork - GeoNetwork repository

I think this change should work

      // Set the default browse mode for the home page
      $scope.$watch('searchInfo', function (n, o) {
        if (angular.isDefined($scope.searchInfo.facet)) {
          if ($scope.searchInfo.facet['categories'].length > 0) {
            $scope.browse = 'cat';
          } else if ($scope.searchInfo.facet['inspireThemes'].length > 0) {
            $scope.browse = 'inspire';
          } else if ($scope.searchInfo.facet['topicCats'].length > 0) {
            $scope.browse = 'topics';
          } else {
             // If no match set default to categories
             $scope.browse = 'cat';
          }
        }
      });

Assuming in home.html you have something like this for the categories.

<label data-ng-show="searchInfo.facet['categories'].length > 0">
          <input type="radio" name="browse" value="cat" data-ng-model="browse"/>
          <span data-translate="">categories</span>
        </label>

Make sure to clean your browser cache and also the wro4j cache.

Regards,
Jose García

On Wed, Jul 11, 2018 at 12:21 PM, Eugenio Trumpy <frippe12573@anonymised.com<mailto:frippe12573@anonymised.com>> wrote:

Dear Josè and all,

I have already tried to change the order of the radio buttons,

but it doesn't change the default radio button.

I tested also to change the content of the ['facet name'] putting the categories in the first radio button,

but nothing changed.

I didn't want to move the section in another place, just put categories (I mean the GN categories, not the topic categories) as default.

Any other input is very appreciated.

Eugenio

________________________________
Da: Jose Garcia <jose.garcia@anonymised.com<mailto:jose.garcia@anonymised.com>>
Inviato: mercoledì 11 luglio 2018 12:13
A: frippe12573
Cc: Geonetwork-Users@anonymised.com<mailto:Geonetwork-Users@anonymised.com>
Oggetto: Re: [GeoNetwork-users] set default browse mode

Hi

The html code to display the radio buttons for browse by topic categories and inspire themes is the following:

https://github.com/geonetwork/core-geonetwork/blob/3.2.x/web-ui/src/main/resources/catalog/views/default/templates/home.html#L37

Not sure what change you require. If it's just the order of the radio buttons, you can check to update that snippet (see input type="radio" elements to reorder them) or if you need to move the full section to other page location, I guess can be copied all related code that handles that section to a new location, but requires to be tested.

Regards,
Jose García

On Wed, Jul 11, 2018 at 9:35 AM, frippe12573 <frippe12573@anonymised.com<mailto:frippe12573@anonymised.com>> wrote:
Hi all,

in GN3.2 I would like to modify a bit the home page.
I have already added categories to the radio button
related to 'Browse by'. I would like to change the default
position of the radio button.
I say in module.js some lines related to this aspect,
but I don't understand how to change the code to
have the wanted effect.

Could you give me an hint?

Best

Eugenio

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoNetwork-users-f3860293.html

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net<mailto:GeoNetwork-users@anonymised.comforge.net>
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

--
Vriendelijke groeten / Kind regards,

Jose García

[https://www.geocat.net/wp-content/uploads/2015/07/GeoCat_small1.png\]<http://www.geocat.net/&gt;
Veenderweg 13<https://maps.google.com/?q=Veenderweg+13+ +6721+WD+Bennekom+ +The+Netherlands&entry=gmail&source=g&gt;
6721 WD Bennekom<https://maps.google.com/?q=Veenderweg+13+ +6721+WD+Bennekom+ +The+Netherlands&entry=gmail&source=g&gt;
The Netherlands<https://maps.google.com/?q=Veenderweg+13+ +6721+WD+Bennekom+ +The+Netherlands&entry=gmail&source=g&gt;
T: +31 (0)318 416664<tel:+31318416664>

[https://www.geocat.net/wp-content/uploads/2015/07/facebook_24.png\]<https://www.facebook.com/geocatbv&gt; [https://www.geocat.net/wp-content/uploads/2015/07/Twitter_icon.png\] <https://twitter.com/geocat_bv&gt; [https://www.geocat.net/wp-content/uploads/2015/07/Google-plus-icon.png\] <https://plus.google.com/u/1/+GeocatNetbv/posts&gt;

Please consider the environment before printing this email.

--
Vriendelijke groeten / Kind regards,

Jose García

[https://www.geocat.net/wp-content/uploads/2015/07/GeoCat_small1.png\]<http://www.geocat.net/&gt;
Veenderweg 13
6721 WD Bennekom
The Netherlands
T: +31 (0)318 416664<tel:+31318416664>

[https://www.geocat.net/wp-content/uploads/2015/07/facebook_24.png\]<https://www.facebook.com/geocatbv&gt; [https://www.geocat.net/wp-content/uploads/2015/07/Twitter_icon.png\] <https://twitter.com/geocat_bv&gt; [https://www.geocat.net/wp-content/uploads/2015/07/Google-plus-icon.png\] <https://plus.google.com/u/1/+GeocatNetbv/posts&gt;

Please consider the environment before printing this email.