Widgets

Widgets in Osclass provide a way to add dynamic content, localized text, or custom HTML to specific sections of a theme without modifying the core template files. Administrators can use widgets to insert additional content into predefined locations on their website.

Managing Widgets

Widgets are managed under Appearance > Widgets. Each theme defines its own widget locations, which are specified in the theme's index.php file.

Manage widgets
Manage widgets

Available widget actions include:

  • Adding Widgets: Administrators can insert widgets into predefined sections of the theme.
  • Editing Widgets: Modify widget content, including text, HTML, JavaScript, or other dynamic content.
  • Deleting Widgets: Remove unwanted widgets to declutter the website.

Widget Locations

Each Osclass theme includes predefined locations where widgets can be placed.

Add/edit widget
Add/edit widget

These locations vary depending on the theme but may include:

  • Header: Widgets placed at the top of the website.
  • Sidebar: Commonly used for navigation menus, advertisements, or additional content.
  • Footer: Widgets placed at the bottom of the page, such as contact details or social media links.
  • Homepage: Some themes allow widgets to be placed directly on the homepage.

Customizing Widgets

Administrators can customize widget content to match the site's branding and requirements. Customization options include:

  • Custom HTML: Insert static content, such as promotional messages or advertisements.
  • Custom JavaScript: Add scripts for interactive elements or analytics tracking.
  • CSS Customization: Style widgets using custom CSS rules to maintain consistency with the theme.

Theme Compatibility

Not all themes support widgets. If a theme does not include predefined widget locations, administrators will not be able to add or manage widgets for that theme. It is recommended to check the theme documentation before attempting to use widgets.

Conclusion

Widgets provide an easy way to enhance an Osclass website without modifying theme files. By using widgets effectively, administrators can customize page layouts, insert additional content, and improve user experience without requiring direct code changes.