Hemm, from what I can see, if you need to have 2 select box or 2 list of links or 2 tables with a list of links or etc...
Thank you only need 3 chunks with 1 snippet.
You will one chunk to be the main template, for example
Here is the title...
<select>
{+list1+}
</select>
<select>
{+list2+}
</select>
Here is the footer...
Two chunks for each list, for example
<option value="{+value+}">{+name+}</option>
Then you need one snippet to do the logic of fetching the data and generating the data into whatever that you want. So the logic will be to generate data for listing one, call out the chunk for the first list template loop, and replace the {+value+} and {+name+} with the data that you generate in the code, and keep the output in one string variable, and appended each output from the loop to be store inside the var. Do the same thing with the second listing with a different var. Now you have 2 string variables with the generated data combined with the template loop. All you need to do now is to use the main template, and substitute {+list1+} and {+list2+} with this 2 variables. Than of you go. You can have whatever output that you want, without limited to select box.
Here is the API that might be usefull for you. What it does is actually fetch the chunk, and replace the special tag, such as {+array_name+} with the value on the asociative array included inside the parameter.
function parseChunk($chunkName, $chunkArr, $prefix="{", $suffix="}") {
if(!is_array($chunkArr)) {
return false;
}
$chunk = $this->getChunk($chunkName);
foreach($chunkArr as $key => $value) {
$chunk = str_replace($prefix.$key.$suffix, $value, $chunk);
}
return $chunk;
}
So what do you think? Your designer doesn’t even have to understand about template looping syntax. All that they need to know that the list1 and list2 template will be repeated and being put on the main template. Which the benefit is, you have the tag in plain simple bracket, that doesn’t require your designer to learn about the syntax logic for templting.
Hope it helps.