Open portal page in a modal

kcf
Tera Expert

How do i open another portal page in a modal?  i have a single widget with many options configured on that widget, thats why i figured i should just open the page as i have the widget instance configured. 

 

heres what i have to open a widget, but not sure how to open a page....or you can tell me how to pass many options to open the widget with...:

Body HTML:

  <div class="pull-right padding-view col-xs-6">
      <a href="?id="   style="color:#005F9E;font-size:12px" ng-click="c.openOutageModal('lg')">View Past Outages</a>
  </div>

<!--Modal popup for outage history-->
<script type="text/ng-template" id="modalOutageTemplate">
	<div class="panel panel-default">
		<div class="panel-heading">
			<h4 class="panel-title">Outages in the past 7 days</h4>
  		</div>
		<div class="panel-body wrapper-xl">
			<sp-widget widget="data.outageHistory"></sp-widget>
  		</div>
	</div>
</script>

 

Server Script:

var outageHistoryOptions = {"page_id":"cg_outage_history_tiles", "type_id": "2f49aa5ddbabf7800f34fcfa0c961978"};
data.outageHistory = $sp.getWidget('cg_outage_history_tiles', outageHistoryOptions);

Client Controller:

function ($scope, spUtil, snRecordWatcher, $rootScope, $location, $uibModal) {
	var c = this;

	
	
	
	// functions for SPmodals
	c.openOutageModal = function(size) {
		c.modalOutageInstance = $uibModal.open({
			templateUrl: 'modalOutageTemplate',
			scope: $scope,
			size: size
		}).closed.then(function(){
			spUtil.update($scope);
		});
     };


	
}
3 REPLIES 3

Jace Benson
Mega Sage
I’ve only embedded a widget in the past. Not sure 🤔 if you can embed a page similarly. Here’s how I’ve done it. https://jace.pro/post/2019-08-25-sp-embedded-widgets/ I’ll try embedding a page and see what happens.

were you ever able to get a defined service now page to display in a modal window?  i need to do this and was hoping for some help.

I have not.  I've only done it the way I linked above.