Hero Banner

Sidebars and Widgets

Absolutely! Here’s clear documentation for the Sidebar & Widget Management system in your FearlessCMS admin panel:


Sidebar & Widget Management

FearlessCMS provides a flexible widget system that allows you to add, arrange, and manage widgets in any sidebar location defined by your theme. This system is designed to be intuitive and automatically adapts to your theme’s structure.


1. How Sidebars Are Detected

  • Automatic Detection:
    Any time your active theme’s template files contain a placeholder like {{sidebar=sidebar_id}}, FearlessCMS will automatically detect and register a sidebar with the ID sidebar_id.
  • Naming:
    The sidebar’s display name is generated from the ID (e.g., left-sidebar becomes Left Sidebar).
  • Dynamic Update:
    If you add or remove {{sidebar=...}} placeholders in your theme and reload the admin panel, the sidebar list will update accordingly.

2. Managing Sidebars

  • Viewing Sidebars:
    Go to Widgets in the admin panel. All detected sidebars will appear in the “Select Sidebar” dropdown.
  • Creating Sidebars:
    You can manually create a sidebar using the “Create Sidebar” form. This is useful for testing or for sidebars not yet present in your theme.
  • Deleting Sidebars:
    Select a sidebar from the dropdown and click the Delete Sidebar button.
    Warning: Deleting a sidebar will also delete all widgets assigned to it.

3. Managing Widgets

  • Viewing Widgets:
    After selecting a sidebar, all widgets assigned to it will be listed.
  • Adding Widgets:
    Use the “Add Widget” form to add a new widget to the selected sidebar. You can choose the widget type (HTML, Text, Markdown), set a title, and enter content.
  • Editing Widgets:
    (If implemented) Click the Edit button next to a widget to modify its content and settings.
  • Deleting Widgets:
    Click the Delete button next to a widget to remove it from the sidebar.
  • Reordering Widgets:
    Drag and drop widgets in the list to change their order. The new order is saved automatically.

4. How Widgets Appear on Your Site

  • Wherever your theme template includes a {{sidebar=sidebar_id}} placeholder, all widgets assigned to that sidebar will be rendered in the order you set.
  • You can have as many sidebars as you want, and each can have its own unique set of widgets.

5. Tips & Best Practices

  • Theme Development:
    When building or editing a theme, simply add {{sidebar=your_sidebar_id}} wherever you want a widget area.
  • Safe Deletion:
    Deleting a sidebar or widget is permanent. Make sure you want to remove it before confirming.
  • Widget Types:
    Use Markdown widgets for formatted content, HTML widgets for custom code, and Text widgets for plain text.

6. Troubleshooting

  • Sidebar Not Showing?
    Make sure your theme template contains the correct {{sidebar=sidebar_id}} placeholder and that you’ve reloaded the admin panel.
  • Widgets Not Appearing?
    Ensure you’ve added widgets to the correct sidebar and that the sidebar is present in your theme.

7. Example

In your theme template:

<aside>
  {{sidebar=left}}
</aside>
<footer>
  {{sidebar=footer}}
</footer>

In the admin panel:

  • You’ll see “Left” and “Footer” as available sidebars.
  • Add widgets to each as desired.

Enjoy building with FearlessCMS!
If you have questions or need help, just ask!