Allows for multiple Component Contents.
Currently, WOComponentContent can only access a single subtemplate. We need a
way to pass several named contents.
==============================
Parent component:
==============================
<webobject name=SomeComponent>
This text will be ignored (unless you use WOComponentContent without templateName
in which case the templates will get appended twice!)
<webobject name=Template1>
This is the first template
</webobject>
<webobject name=Template2>
This is the second template
</webobject>
<webobject name=Template3>
This is the third template
</webobject>
</webobject>
===========
Parent wod:
===========
SomeComponent: SomeComponent {
someIvar = someValue;
}
Template1: ERXWOTemplate {
templateName = "firstTemplate";
}
Template2: ERXWOTemplate {
templateName = "secondTemplate";
}
Template3: ERXWOTemplate {
templateName = "thirdTemplate";
}
==============================
Child Component (SomeComponent)
==============================
Some static html
<webobject name=ComponentContent1>
This is the default content if "firstTemplate" is not defined by parent
</webobject>
<webobject name=Repetition>
<webobject name=ComponentContent3>
This is the default content if "thirdTemplate" is not defined by parent
</webobject>
</webobject>
<webobject name=ComponentContent2>
This is the default content if "secondTemplate" is not defined by parent
</webobject>
some more static html
===========
Child wod:
===========
ComponentContent1: ERXWOComponentContent {
templateName = "firstTemplate";
}
ComponentContent2: ERXWOComponentContent {
templateName = "secondTemplate";
}
ComponentContent3: ERXWOComponentContent {
templateName = "thirdTemplate";
}
So, the way this could work is to add functionality to WOComponentContent
which allows it to iterate through its elements and locate the named
templates. It also needs to be extended so that it takes the contents of its
reference as a default if no named template is provided/found.
<webobject name=IfThenElse>
<webobject name=TrueBlock>
This is true block
</webobject>
<webobject name=FalseBlock>
This is false block
</webobject>
</webobject>
IfThenElse: IfThenElseComponent {
condition = someCondition;
}
Template1: ERXWOTemplate {
templateName = "true";
}
Template2: ERXWOTemplate {
templateName = "false";
}