---
title: "if-else statement in itemTpl in Sencha Touch"  
description: "if-else statement in itemTpl in Sencha Touch"  
author: "Anonymous User"  
published: 2013-06-14  
updated: 2013-06-25  
canonical: https://www.mindstick.com/forum/1082/if-else-statement-in-itemtpl-in-sencha-touch  
category: "sencha touch"  
tags: ["sencha touch"]  
reading_time: 1 minute  

---

# if-else statement in itemTpl in Sencha Touch

Hi,\
How to write **if-else** statement in **itemTpl** configuration of list in **[Sencha Touch](https://www.mindstick.com/interview/23004/define-class-system-of-sencha-touch)**.\
Any help on above is really appreciated.\

## Replies

### Reply by Sumit Kesarwani

Hi Samuel,\
You can write the if-else condition in itemTpl configuration of list using <tpl> tag like this:

itemTpl: [

'<tpl if="boolean == \'true\'">',

' <p>{name}</p>',

' <tpl else>',

' <p>Boolean is false</p>',

'</tpl>'

]

\

If you want to learn more about itemTpl configuration , then you can read my article:

[If- else statement in itemTpl configuration](https://www.mindstick.com/Articles/1338/if-else-statement-in-itemtpl-configuration)


---

Original Source: https://www.mindstick.com/forum/1082/if-else-statement-in-itemtpl-in-sencha-touch

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
