The CreatorCon Call for Content is officially open! Get started here.

hide typeahead on one page in ESC portal header

Shilpa31
Kilo Guru

Hi,

We need to hide typeahead on one page in ESC portal header. 

Have used ng-if="$sp.getParameter('id')!='this-page'" in the Header widget of ESC portal but this gives error and hides in all pages. 

Also, tried fetching id in Server Side if page is 'this-page' then set a data.var = false and in html add it in ng-if where the widget is called. This has no effect, infact the variable always shows as undefined in log. 

in ESC portal, there is a JSON which is defined to hide widget only for Homepage.

Is there as way 'this-page' could be included as well. 

Appreciate your response.

 find_real_file.png

1 ACCEPTED SOLUTION

Shilpa31
Kilo Guru

Got answer

In ESC Theme Header - Client Controller - $scope.showSearchBar = false; 

// hide on home page
if ((params && params.id && params.id === c.data.dashboardSuffix) || (params && !params.id && currentUrl.includes(c.data.portalSuffix)) || (c.data.idparam =="<Page>"))
$scope.showSearchBar = false;
else
$scope.showSearchBar = true;
}

Comment line :    $scope.showSearchBar = true; - Which is available post above code

c.data.idparam - has value of current page id using $sp.getParameter("id) from server script.

View solution in original post

1 REPLY 1

Shilpa31
Kilo Guru

Got answer

In ESC Theme Header - Client Controller - $scope.showSearchBar = false; 

// hide on home page
if ((params && params.id && params.id === c.data.dashboardSuffix) || (params && !params.id && currentUrl.includes(c.data.portalSuffix)) || (c.data.idparam =="<Page>"))
$scope.showSearchBar = false;
else
$scope.showSearchBar = true;
}

Comment line :    $scope.showSearchBar = true; - Which is available post above code

c.data.idparam - has value of current page id using $sp.getParameter("id) from server script.