ForumSpark Support app Faster, straight from your home screen. Tap Share, then Add to Home Screen.
Add ForumSpark Support to your home screen
  1. Tap Share at the bottom of Safari.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add. ForumSpark Support now opens like an app.
  1. Tap Install, or open the browser menu.
  2. Choose Install app or Add to Home screen.
  3. Confirm. ForumSpark Support now opens like an app.

Information Box

Cedric's Avatar
Cedric · in Themes & Extensions
7 replies 275 views

Preview: https://prnt.sc/7eND-kR2pgmd

Overview:
This code creates an "Information Box" component for your forum, which can be used to display key sections like links, important announcements, and affiliate information in a structured, visually separated layout.

Links Section: Displays a list of links (e.g., forum-related pages or external links).
Important Text Section: A central area where you can put announcements, rules, or any other important messages for users.
Affiliates Section: Lists affiliate partners or other external entities you want to highlight.

Customization:

  • The layout is responsive and adjusts the sectionsโ€™ widths. The links and affiliates sections each take up 20% of the width, while the important text section takes up 60%, ensuring the message is the focal point. But you can change this to 33% each.
  • Each section has its own heading and list of items (links or affiliates) that can be easily updated.

Usage:
Where to place: The code should be placed in the theme layout between the <!-- TOPMENU --> and <!-- NAV --> comments, ensuring it displays above the main navigation but below the top menu.
Why use it: This component is ideal for displaying important information to users in a clean and organized manner, such as news, rules, or affiliate partnerships.
Itโ€™s flexible enough to be adapted or expanded based on what content you need to display to your forum members.

<br><br>
<div class="panel" style="width: 67%; margin: 0 auto; text-align: center;">
    <div class="panel__title" style="margin-top: 2px; font-size: 1.125rem; line-height: 1.75rem; font-weight: 600; text-shadow: 0 1px 0 rgba(0, 0, 0, .4);"><b>Information Box</b></div>
    <div x-show="! collapsed" class="panel__content panel__content--flush">
        <div class="forum__description" style="display: flex; flex-wrap: wrap; justify-content: space-between; box-sizing: border-box;">
            <!-- Links Section -->
            <div style="flex: 1 1 20%; padding-right: 1.5rem; border-right: 1px solid #ddd; box-sizing: border-box;">
                <h3 style="text-align: center; font-size: 1.2rem; font-weight: bold; margin-top: 2px; margin-bottom: 1rem; border-bottom: 1px solid #ddd; padding-bottom: 0.5rem;">Links</h3>
                <ul style="list-style: none; padding-left: 0.5rem; margin: 0;">
                    <li><a href="#link1">Link 1</a></li>
                    <li><a href="#link2">Link 2</a></li>
                    <li><a href="#link3">Link 3</a></li>
                </ul>
            </div>

        <!-- Text Section -->
        <div style="flex: 1 1 60%; padding-right: 1.5rem; border-right: 1px solid #ddd; box-sizing: border-box;">
            <h3 style="text-align: center; font-size: 1.2rem; font-weight: bold; margin-top: 2px; margin-bottom: 1rem; border-bottom: 1px solid #ddd; padding-bottom: 0.5rem;">Important Text</h3>
            <p style="margin: 1rem; padding-left: 0.5rem;">This section contains important information for users, such as announcements, rules, or updates.</p>
        </div>

        <!-- Affiliates Section -->
        <div style="flex: 1 1 20%; padding-right: 1.5rem; box-sizing: border-box;">
            <h3 style="text-align: center; font-size: 1.2rem; font-weight: bold; margin-top: 2px; margin-bottom: 1rem; border-bottom: 1px solid #ddd; padding-bottom: 0.5rem;">Affiliates</h3>
            <ul style="list-style: none; padding-left: 0.5rem; margin: 0;">
                <li><a href="#affiliate1">Affiliate 1</a></li>
                <li><a href="#affiliate2">Affiliate 2</a></li>
                <li><a href="#affiliate3">Affiliate 3</a></li>
            </ul>
        </div>
    </div>
</div>
<div x-show="! collapsed" class="panel__footer"></div>
</div>

<style>
    /* Ensure that the sections wrap and adjust width on smaller screens */
    @media (max-width: 768px) {
        .forum__description {
            display: block;
        }
        .forum__description > div {
            max-width: 100%;
            flex: 1 1 100%;
            margin-bottom: 1rem;
        }
    }
</style>

It would be super cool if there was a way to only have this on the index page.

Hulk said:

It would be super cool if there was a way to only have this on the index page.

You can add an ID to the start tag:

<div class="panel" id="info-box" style="width: 67%; margin: 0 auto; text-align: center;">

Then use this:

body:not(.page-board-home) #info-box {
display: none;
}

Yep, exactly like Cory says. :)

Nice, already got main for a while now, so many ways to go about ;)

"Please remain seated. The captain has absolutely no idea what heโ€™s doing."

The preview seems to be broken, I'd like to see what it does before adding it to my forum, thanks.

Here's a preview:

Thanks Cory for the preview

You might also like...

Topic Replies Views Last reply
Boo & Co Popular in Themes & Extensions, started by Cedric, 2 months ago
19 549
Cedric's Avatar
Cedric4 days ago
Horizon Popular in Themes & Extensions, started by Cedric, 3 months ago
9 280
Cedric's Avatar
Cedric3 months ago
Quests Popular in Themes & Extensions, started by Cedric, 2 days ago
8 264
Cedric's Avatar
Cedric4 hours ago
Classifieds Popular in Themes & Extensions, started by Cedric, 2 days ago
7 246
Cedric's Avatar
Cedric1 day ago
Flurry Popular in Themes & Extensions, started by Cedric, 2 months ago
6 239
Cedric's Avatar
Cedric2 months ago