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   1453 Views

Avatar
Aperage

Community Member, 6 Posts

17 December 2009 at 8:30am

Edited: 17/12/2009 8:38am

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

Forum Moderator, 5513 Posts

17 December 2009 at 8:57am

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.