Wednesday 18 August 2004 3:24:22 am
Hi folks! I have made an article class that contains two images. None of them are required.
If there are no pictures I want to use the whole table width to display the text.
If only picture1 has content this image will be placed in the left column.
If only picture2 has content this image will be placed in the right column. If both picture1 and picture2 have content, I will use a three column layout with text in the middle. This is how I had thought this would be done:
<table>
{section show=and($node.data_map.bilde1.has_content, $node.data_map.bilde2.has_content) }
<tr>
<td>picture1</td>
<td>text</td>
<td>picture2</td>
<tr>
{section-else show=and($node.data_map.bilde1.has_content, $node.data_map.bilde2.has_content|not) }
<tr>
<td>picture1</td>
<td colspan="2">text</td>
<tr>
{section-else show=and($node.data_map.bilde1.has_content|not, $node.data_map.bilde2.has_content) }
<tr>
<td colspan="2">text</td>
<td>picture2</td>
<tr>
{section-else}
<tr>
<td colspan="3">text</td>
<tr>
{/section}
</table>
Given that using xml-textfields as containers where I can put images is not an option, are there any easier methods to do the same thing? I don't even know if this will work. I'm a bit unsure whether I can use "show=" after section-else.... Any thoughts anyone?
best regards trondåge
trondåge
|