Skip to main content

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("ddata-id='5000223941']").hide();
}); }
</script>

 

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 :)


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!


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 😊


@zachary.king  this is awesome! To clarify, where did you put this script? In the footer? Also, were you able to get those items hidden from searches too?


Reply