- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2017 06:30 AM
Hi everyone,
Is there any way to hide portal header when it is opened in navpage? Also Customer wants to keep it hidden in all pages when opened in navpage. But in the SP, header should be displayed. I searched it, couldn't find any solution yet.
Any help will be appreciated. Thanks in advance.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2017 02:38 PM
hi Alper,
I think you can achieve this by editing the OOTB stock header.
1. Navigate to "Headers & Footers" -> Stock Header.
2. Click clone widget.
3. Modify the widget client script to check if it is in iframe, hide the top menu bar if it is.
HTML:
<div id="stock_header_id">
<nav class="navbar-inverse" ng-class="::{'navbar':!isViewNative, 'is-native': isViewNative}"
...
Client Script (add to the bottom):
//if inside an iframe
if((window.self !== window.top))
{
var header_element = document.getElementById('stock_header_id');
header_element.hide();
}
4. set the new cloned widget as the theme stock header.
Themes -> Stock -> Header.
I tried it and it is working on my instance.
cheers.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2017 02:38 PM
hi Alper,
I think you can achieve this by editing the OOTB stock header.
1. Navigate to "Headers & Footers" -> Stock Header.
2. Click clone widget.
3. Modify the widget client script to check if it is in iframe, hide the top menu bar if it is.
HTML:
<div id="stock_header_id">
<nav class="navbar-inverse" ng-class="::{'navbar':!isViewNative, 'is-native': isViewNative}"
...
Client Script (add to the bottom):
//if inside an iframe
if((window.self !== window.top))
{
var header_element = document.getElementById('stock_header_id');
header_element.hide();
}
4. set the new cloned widget as the theme stock header.
Themes -> Stock -> Header.
I tried it and it is working on my instance.
cheers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2017 04:45 AM
thank you Bryan, It works but in console, it gives an error. the code below doesn't give any error.
Client Script:
if((window.self !== window.top)) { jQuery('#stock_header_id').hide(); }