Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

We are going to use the notation that allows you to define which sections of the template will be populated for each issue, and which sections will be static:

&{for issues}

You can use Use a Conditional Block #{if...} to know indicate whether to iterate or not.

We are going to put Put the mapping ${Key} to know indicate which issues are being populated. 

If the issue doesn't have images, you can set the message to be displayed display a message instead.

Code Block
titleExpand to see the sample code
collapsetrue
#{if (%{'${ImagesCount}' == 0})}
Doesn't have Images.
#{end}

If the issue does have has images, you can set the message to display the number of images, along with the images image Iteration.

Code Block
titleExpand to see the sample code
collapsetrue
#{if (%{'${ImagesCount}' > 0})}
There are ${ImagesCount} images.

In this case, you don't close the mapping #{end} because we are going to do an iteration before closing the conditional block.

Below it you , put the #{for images} or #{for <VariableName>=ImagesCount} statement.

We are going to put Put the mapping to display an image with maxwidth max width and maxheightmax height.

${Images[n].Image|maxwidth=100|maxheight=100}

Info

You can customize the maxwidth and the maxheight.

Now, you can create a table where the details of the image will be populated:

Name${Images[n].Name}
HumanReadableSize${Images[n].HumanReadableSize}
CreatedDateTime${dateformat("dd-MM-yyyy HH:mm:ss")Images[n].Created}
MimeType${Images[n].MimeType}
Info

There are more For a list of fields to be populated on the iteration of images that you can when iterating images, check here.

Finally, close the two statements using the mapping #{end}.

However, You can also put a conditional block to print only the image that you want. We are going to do an iteration again of #{for images} or #{for <VariableName>=ImagesCount} statement.

And below Below it, we are going to use a conditional block:

#{if (%{"${Images[n].Name}".equals("xporter.png")})}

Info

With the conditional block count that you have defined above, we are going to enter if the conditional block is true.

On our caseIn this example, we have attached on out issue an image whose name is named xporter.png. Don't forget to attach images to your issue.

We are going to put the mapping to display an image with maxwidth and maxheight, putting this mapping so the mapping is ${Images[n].Image|maxwidth=100|maxheight=100}

Now, close Close the two statement using the mapping #{end}.

Finally, close the &{for issues} that you opened on at the beginning, using the mapping &{end}.

Below there is a sample of how the mappings will be displayed in a word Word template:

This Template has:

  • A header with an image
  • Headings
  • Text styling
  • Table

Below there Below is a sample of how the generated file will be populated:

Congratulations you ! You passed on the intermediate Intermediate level (smile) Go Proceed to the next level.

Info

If you like this exercise, please share your opinion on the page by just leaving leave a comment or a (thumbs up). Your opinion feedback is very important to us.

Thank you in advance.

Enjoy our product. (big grin)

Expand
titleClick here to see the Exercise 7 resources

Here 's the Exercise 7 related filesare the files related to this Exercise:

FileDescription
Exercise7Template

Exercise 7 Sample Template file

Exercise7GeneratedExercise 7 Sample generated file