-
Hi SP friends, I have multiple pictures that now are overlaid so I want to count their total amount: <!-- IMAGE BLOCK BASE -->
<ForAll select="img">
<PlaceObject column="1" row="1" align="left">
<Table width="8" stretch="max" fontfamily="subtitle" padding="3mm" >
<Tr align="center" valign="middle">
<Td>
<Overlay>
<Image file="{@file}" maxheight="10" maxwidth="7"
rotate="{if ( sd:aspectratio(@file) < 1 ) then '-90' else '0'}"/>/>
</Overlay>
</Td>
</Tr>
</Table>
</PlaceObject>
</ForAll> Just right below a paragraph, it should print the output: <PlaceObject>
<Textblock width="8" fontfamily="subtitle" textformat="nohyphen">
<Paragraph textformat="centered">
<Value>Total numbers of picutures: </Value><Value select="count('Image')" />
</Paragraph>
</Textblock>
</PlaceObject> This is not working and I have not idea on how to use Thanks! 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I assume your question is similar to this setup: <data>
<img name="one" />
<img name="two" />
<img name="three" />
</data> and the layout file: <Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en">
<Record element="data">
<ForAll select="img">
<PlaceObject>
<Textblock>
<Paragraph>
<Value select="@name" />
</Paragraph>
</Textblock>
</PlaceObject>
</ForAll>
</Record>
</Layout> You have two posibilities: <Record element="data">
<ForAll select="img">
<PlaceObject>
<Textblock>
<Paragraph>
<Value select="@name" />
</Paragraph>
</Textblock>
</PlaceObject>
</ForAll>
<PlaceObject>
<Textblock>
<Paragraph>
<Value select="count(img)"></Value>
</Paragraph>
</Textblock>
</PlaceObject>
</Record> or <Record element="data">
<SetVariable variable="c" select="0" />
<ForAll select="img">
<SetVariable variable="c" select="$c + 1" />
<PlaceObject>
<Textblock>
<Paragraph>
<Value select="@name" />
</Paragraph>
</Textblock>
</PlaceObject>
</ForAll>
<PlaceObject>
<Textblock>
<Paragraph>
<Value select="$c"></Value>
</Paragraph>
</Textblock>
</PlaceObject>
</Record> I hope that these examples are self explanatory. If not, or if I have misunderstood anything, please post a follow-up. |
Beta Was this translation helpful? Give feedback.
-
Thank you @pgundlach The pebcak was that I used |
Beta Was this translation helpful? Give feedback.
I assume your question is similar to this setup:
and the layout file:
You have two posibilities: