> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mastermindcms.com/llms.txt
> Use this file to discover all available pages before exploring further.

# msm:if

> Conditional rendering

`<msm:if>` renders its inner content only if the condition is true.

## Skeleton

```html theme={null}
<msm:if id="loggedIn" bean="userServiceImpl" scope="SESSION" test="isLoggedIn">
  <msm:template>
    <div>Welcome back!</div>
  </msm:template>
</msm:if>
```

## Attributes

| Attribute | Required | Meaning                                                 |
| --------- | -------: | ------------------------------------------------------- |
| `id`      |      yes | Unique condition id.                                    |
| `test`    |      yes | Boolean expression or bean method definition.           |
| `bean`    |       no | Bean id (optional, when `test` is evaluated on a bean). |
| `scope`   |       no | Bean scope (`PROTOTYPE` or `SESSION`).                  |
