Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
replicants rows and cells
nico
How does teamsite handle populating one row with multiple cells with one replicant? For the sake of arguement lets say the table is as such:
<table>
<tr>
<td>thing that has to be in cell 1</td>
<td>thing that has to be in cell 2</td>
</tr>
</table>
Does teamsite know to add additional rows and cells for each replicant? It seems that it would just try to populate the above 2 cells with tons of stuff.
For example lets say the dct code is something like:
<item name="Main Chunk">
<replicant max="10">
<item name="thing that has to be in cell 1">
<text/>
</item>
<item name="thing that has to be in cell 2">
<text/>
</item>
</replicant>
</item>
Mabey my logic when creating the replicant is flawed and there is a better way to set it up, is there? I just don't get it right now.
Thanks,
Nico
Find more posts tagged with
Comments
Migrateduser
What you currently have for your DCT is 2 text fields that the user can replicate up to 10 times (max="10"). How it gets presented is a variable of the presentation template. What you currently have would be easy to produce a 2 column table with up to 10 rows and each row uses the first text field to populate column 1 and the second text field to populate column 2.
If you want a variable number of columns and rows, this would require different logic. So what is it that you are trying to do?
David M. Doggette
Certified Interwoven Consultant
nico
Well if my presentation template has a table with the 10 rows and 2 columns(2 cells per row) and the end user uses only 5 of the 10max replicants wont you have an html page with 5 out of the 10 rows populated? And what happens to the remaining 5 rows? Wont you end up with 5 rows worth of white space? I guess I'm just not understanding how the presentation template knows whether to throw in additional cells and rows when that stuff is already hard coded into the presentation template.
Thanks,
Nico
Migrateduser
Actually, your presentation should not be hard coded but use logic to determine how many rows to create. Using the <iw_iterate> tag is the non perl way of doing things. You can hard code the <table> tag and then within the <iw_iterate> tag, code the <tr><td><iw_value name="whatever"/></td>...</tr> for each row. This way the presentation tag will only create the number of rows that the DCR uses. The perl way would be to do all the logic and table construction within an <iw_perl> tag and then output the html as a string via the iwpt_output() function.
David M. Doggette
Certified Interwoven Consultant