# Frontend Template System

#### Investment Plans Display

Display investment plans using this loop:

```smarty
{foreach from=$index_plans item=p}
```

### Available Variables:

* `{$p.name}` - Plan name
* `{$p.etype}` - Plan type (0: fixed, 1,2: range)
* `{$p.frequency}` - Payout frequency
* `{$p.period}` - Period duration
* `{$p.days}` - Total days

### Usage Example:

```smarty
{foreach from=$index_plans item=p}
    <div class="card">
        <div class="card-header">
            {$p.name|escape:html}
        </div>
        <!-- Plan details here -->
    </div>
{/foreach}
```

#### Recent Transactions

Display recent transactions using:

```smarty
{foreach from=$last_transactions item=s}
```

### Available Variables:

* `{$s.type}` - Transaction type
* `{$s.datetime}` - Transaction time
* `{$s.username}` - User's name
* `{$s.currency}` - Currency used
* `{$s.amount}` - Transaction amount

### Usage Example:

```smarty
{foreach from=$last_transactions item=s}
    <tr>
        <td>{$s.type}</td>
        <td>{$s.datetime|time_elapsed_string}</td>
        <!-- Other transaction details -->
    </tr>
{/foreach}
```

#### News Section

Display news items using:

```smarty
{foreach from=$news key=key item=value}
```

### Available Variables:

* `{$value.title}` - News title
* `{$value.datetime}` - Publication date
* `{$value.content}` - News content
* `{$value.image_url}` - News image
* `{$value.link}` - Full article link

### Usage Example:

```smarty
{foreach from=$news key=key item=value}
    <div class="card">
        <img src="{$value.image_url}" alt="{$value.title}">
        <!-- News content here -->
    </div>
{foreachelse}
    <!-- No news found message -->
{/foreach}
```

#### User Reviews

Display user reviews using:

```smarty
{foreach from=$last_reviews item=s}
```

### Available Variables:

* `{$s.uname}` - Reviewer's name
* `{$s.datetime}` - Review time
* `{$s.review}` - Review content

### Usage Example:

```smarty
{foreach from=$last_reviews item=s}
    <div class="card">
        <div class="card-body">
            <h5>{$s.uname|escape:html}</h5>
            <!-- Review content here -->
        </div>
    </div>
{/foreach}
```

#### Affiliate Program Structure

Display affiliate program details using:

```smarty
{for $i=1 to $settings.referral.levels}
{foreach $settings.referral.tier as $tierId => $tier}
```

### Available Variables:

* `{$tier.name}` - Tier name
* `{$tier.level}` - Commission levels
* `{$tier.invested}` - Required investment
* `{$tier.investments}` - Team investment
* `{$tier.referrals}` - Required referrals

### Usage Example:

```smarty
<table class="table">
    <tr>
        <th>Tier</th>
        <!-- Table headers -->
    </tr>
    {foreach $settings.referral.tier as $tierId => $tier}
        <!-- Tier details here -->
    {/foreach}
</table>
```

#### Payment Methods

Display payment methods using:

```smarty
{section name=p loop=$ps}
```

### Available Variables:

* `{$ps[p].id}` - Payment method ID
* `{$ps[p].name}` - Payment method name

### Usage Example:

```smarty
{section name=p loop=$ps}
    <div class="col-sm-2">
        <img src="images/icons/{$ps[p].id}.svg" class="img" width="30px" />
        {$ps[p].name}
    </div>
{/section}
```

### Important Notes

1. All template files are stored in the `templates` directory
2. Custom modifications should be made in child themes
3. Always escape HTML output using `|escape:html`
4. Use Bootstrap classes for responsive layouts
5. Image paths are relative to the root directory

### Support

For additional support or custom template modifications, please contact:

* Email: <support@bitders.com>
* Documentation: [https://docs.bitders.com](https://docs.bitders.com/)
* Support Hours: 24/7


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bitders.com/front-side/frontend-template-system.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
