Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Template Questions

Nested Controls


Reply

2 Posts   1449 Views

Avatar
Aperage

17 December 2009 at 8:30am (Last edited: 17 December 2009 8:38am), Community Member, 6 Posts

Hey hey,

Is it possible to have nested control?

I have this code here

<% control getSpeciesType %>
<h2>$Type</h2>
<div class="species">
<% control ShowSpeciesByType %>
<h3>$Title</h3>
<p>$Description</p>
<% end_control %>
</div>
<% end_control %>

Both custom functions returns a DataObjectSet. But i've tried debugging by putting an exit(); in my nested function (ShowSpeciesByType) but the script doesn't even get there

So is it possible to have nested Controls??

Thanks
Aperage

Avatar
Willr

17 December 2009 at 8:57am Forum Moderator, 5511 Posts

Yes you can have nested controls but once your in the getSpeciesType control then the scope of the template changes to the SpeciesType object so whatever control you want in that - eg ShowSpeciesByType needs to be a function in the SpeciesType class.