zh Kooboo Logo Documents

Slot

 

Pre-defined slot positions can be dynamically populated with external results at runtime.
 
 
Available directive: 
 
k-slot-define
k-slot-insert
v-slot-define
v-slot-insert
 
Example
 
viewone defines slot:  posone. 
 
<div id=slotview>
    <h2>This view contains slot named: posone</h2> 
    <div k-slot-define="posone">slot content</div> 
</div>
 
parent view, use Viewone and insert content to slot 
 
<script env="server">
	var text = "Hello World"    
</script>
<div id=viewinsert>
	<h2>This view Insert Slot</h2>
	<view id="viewone">
		<div id=frominsert k-slot-insert="posone">
			<p k-content="text"></p>
		</div>
	</view>
</div>
 
Parent view HTML result:
 
<div id=viewinsert>
	<h2>This view Insert Slot</h2>
	<div id=slotview>
    <h2>This view contains slot named: posone</h2> 
    <div id="frominsert">
			<p>Hello World</p>
		</div> 
</div>
</div>