Skip to content

Commit 2c2d455

Browse files
authored
Merge pull request #61 from eynarhaji/main
Add support for if statement inside foreach
2 parents 2c0d52f + 9aa6a1f commit 2c2d455

8 files changed

Lines changed: 336 additions & 172 deletions

File tree

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,18 @@ MiniWord.SaveAsByTemplate(path, templatePath, value);
227227

228228
![before_foreach](https://user-images.githubusercontent.com/38832863/220123955-063c9345-3998-4fd7-982c-8d1e3b48bbf8.PNG)
229229

230+
<img width="755" alt="Screenshot 2023-08-08 at 17 59 37" src="https://github.com/mini-software/MiniWord/assets/38832863/7811bf53-48cf-4fa4-85d7-d98663feb119">
231+
230232
##### Result
231233

232234
![after_foreach](https://user-images.githubusercontent.com/38832863/220123960-913a7140-2fa2-415e-bb3e-456e04167382.PNG)
233235

236+
<img width="755" alt="Screenshot 2023-08-08 at 18 00 15" src="https://github.com/mini-software/MiniWord/assets/38832863/9e1afcf7-64b1-441c-8488-9ea2bd3114a1">
237+
234238
### If statement inside template
235239

236-
Adding `@if` and `@endif` tags to template is required.
240+
For multip paragraph, use @if and @endif tags.
241+
For single paragraph and inside foreach, use `{{if` and `endif}}` tags to template is required.
237242

238243
##### Example
239244

@@ -259,14 +264,21 @@ var value = new Dictionary<string, object>()
259264
MiniWord.SaveAsByTemplate(path, templatePath, value);
260265
```
261266

262-
##### Template
267+
##### Template For Multi Paragraph
263268

264269
![before_if](https://user-images.githubusercontent.com/38832863/220125429-7dd6ce94-35c6-478e-8903-064f9cf9361a.PNG)
265270

266-
##### Result
271+
##### Result Of Multi Paragraph
267272

268273
![after_if](https://user-images.githubusercontent.com/38832863/220125435-72ea24b4-2412-45de-961a-ad4b2134417b.PNG)
269274

275+
##### Template For Single Paragraph
276+
277+
<img width="931" alt="Screenshot 2023-08-08 at 17 55 46" src="https://github.com/mini-software/MiniWord/assets/38832863/2adea468-a9c1-422f-a270-167086bc4ba3">
278+
279+
##### Result Of Single Paragraph
280+
281+
<img width="536" alt="Screenshot 2023-08-08 at 17 56 47" src="https://github.com/mini-software/MiniWord/assets/38832863/01f71c0f-eee0-4189-8510-abe063126514">
270282

271283
### ColorText
272284

release-note/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222

2323
---
2424

25+
### 0.7.1
26+
- [New] Add support to if statement inside foreach statement inside templates. Please refer to samples. (via @eynarhaji)
27+
- [New] Change tags for if statements for single paragraph if statement {{if and endif}} inside templates. Please refer to samples. (via @eynarhaji)
2528

2629
### 0.7.0
2730
- [New] Add support to List inside List via `IEnumerable<MiniWordForeach>` and `{{foreach`/`endforeach}}` tags (via @eynarhaji)
50.4 KB
Binary file not shown.

samples/docx/TestIfStatement.docx

374 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)