Solved

Ability to hide 'child request' forms from the main catalog in portal v2

  • 25 May 2023
  • 3 replies
  • 71 views

Userlevel 1
Badge +5

Does anyone know how to make the script from this thread work in portal v2?

I was using it in v1 to hide a category of child items that no one needed to see, but it doesn’t appear to do anything in v2.

Code for reference:

<script>
var cur_loc = window.location.pathname,
req_loc = "/support/catalog/items";
if (cur_loc == req_loc) {
jQuery(document).ready(function() {
jQuery("#categories").find("[data-id='5000223941']").hide();
}); }
</script>

 

icon

Best answer by zachary.king 25 May 2023, 20:08

View original

3 replies

Userlevel 7
Badge +16

Here is a script that we use in the page layout that hides categories on the V2 Portal.

<!-- Hiding Categories -->
<script>
jQuery(document).on('PageUpdate', function() {
setTimeout(function() {
jQuery("[data-id='"+13000064493+"']").hide();
jQuery("[data-id='"+13000154178+"']").hide();
jQuery("[data-id='"+13000154048+"']").hide();
}, 200);
});
</script>

You would want to substitute the data-id with the id of the category you want to hide, but hopefully that helps :)

Userlevel 1
Badge +5

Here is a script that we use in the page layout that hides categories on the V2 Portal.

<!-- Hiding Categories -->
<script>
jQuery(document).on('PageUpdate', function() {
setTimeout(function() {
jQuery("[data-id='"+13000064493+"']").hide();
jQuery("[data-id='"+13000154178+"']").hide();
jQuery("[data-id='"+13000154048+"']").hide();
}, 200);
});
</script>

You would want to substitute the data-id with the id of the category you want to hide, but hopefully that helps :)

Beautiful, works like a charm. Thank you very much!

Userlevel 7
Badge +16

Here is a script that we use in the page layout that hides categories on the V2 Portal.

<!-- Hiding Categories -->
<script>
jQuery(document).on('PageUpdate', function() {
setTimeout(function() {
jQuery("[data-id='"+13000064493+"']").hide();
jQuery("[data-id='"+13000154178+"']").hide();
jQuery("[data-id='"+13000154048+"']").hide();
}, 200);
});
</script>

You would want to substitute the data-id with the id of the category you want to hide, but hopefully that helps :)

Beautiful, works like a charm. Thank you very much!

My pleasure 😊

Reply