Sc Categories widget for the portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2020 02:29 AM
Using the latest version of the sc categories widget on the portal, I want to clone and add to specific page. On this page, I only want it to show 1 catalog and its underlying categories. I have seen a few articles on here but they all appear to be related to an older version of the widget.
Im thinking I need to update this part of the server script:
(function() {
var catalog_id = $sp.getParameter("catalog_id") ? $sp.getParameter("catalog_id") + "" : "-1";
var catalogSelectorArr = [{value: "-1", displayValue: gs.getMessage("All")}];
data.selectedCatalogIndex = catalog_id == -1 ? 0 : -1;
var catalogIDs = $sp.getCatalogs().value + "";
var catalogs = catalogIDs.split(",");
var isCatalogAccessibleViaPortal = catalog_id == -1 ? true : false;
catalogs.forEach(function(catalogSysId) {
if (catalog_id == catalogSysId) {
isCatalogAccessibleViaPortal = true;
}
});
But as my scripting isnt up to scratch, I am not sure where I would need to define the specific catalog sysId
Any help would be appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2022 03:48 AM
Hi ,
I am also trying to implement the same thing for my client , but seems its not working properly,
(function() {
var catalog_id = $sp.getParameter("catalog_id") ? $sp.getParameter("catalog_id") + "" : "-1";
var catalogSelectorArr = [{value: "-1", displayValue: gs.getMessage("All")}];
data.selectedCatalogIndex = catalog_id == -1 ? 0 : -1;
var catalogIDs ='3Dcbd4c5922f42011054ea877cf699b694';
var catalogs = catalogIDs.split(",");
var isCatalogAccessibleViaPortal = catalog_id == -1 ? true : false;
catalogs.forEach(function(catalogSysId) {
if (catalog_id == catalogSysId) {
isCatalogAccessibleViaPortal = true;
}
})
Catalog field (which contains all the Catalog choices) is not visible on the page even HR Catalog items are getting on the page.