Ad Area System Guide
The Ad Area System is a conditional advertising feature that displays promotional content only when the CMS is in hosting service mode. This system provides hosting providers with a professional way to showcase their services while maintaining a clean experience for self-hosted users.
๐ Table of Contents
- Overview
- How It Works
- CMS Mode Integration
- Template System
- Theme Integration
- Customization
- Testing
- Troubleshooting
- Advanced Features
- Conditional Display: Ads only appear in hosting service modes
- Theme Consistency: Same ad appearance across all themes
- Professional Design: Modern, responsive advertising interface
- User Control: Close button for user preference
- Easy Maintenance: Single template file for all themes
๐ฏ Overview
The Ad Area System provides:
When Ads Are Visible
| CMS Mode | Ad Area Status | |----------|----------------| | Full Featured | โ Hidden | | Hosting Service (Plugin Mode) | โ Visible | | Hosting Service (No Plugin Management) | โ Visible |
๐ง How It Works
Conditional Logic
The ad area uses template conditional syntax to determine visibility:html
{{#if isHostingServiceMode}}
{{/if}}
Template Variables
The system provides these variables to templates:full-featured
- Current CMS mode identifierfalse
- Boolean for conditional logicFull Featured
- Human-readable mode nameInclude System
Themes include the ad area using:html
{{include=ad-area.html}}
๐ CMS Mode Integration
Template Data
The mainindex.php
automatically includes CMS mode information:php
$templateData = [
// ... other data ...
'cmsMode' => $cmsModeManager->getCurrentMode(),
'isHostingServiceMode' => $cmsModeManager->isRestricted(),
'cmsModeName' => $cmsModeManager->getModeName(),
];
Mode Detection
The system automatically detects the current mode fromconfig/cms_mode.json
:json
{
"mode": "hosting-service-plugins"
}
๐ Template System
Ad Area Template
Located atthemes/ad-area.html
, the template includes:Template Structure
html
{{#if isHostingServiceMode}}
{{/if}}
๐จ Theme Integration
Automatic Inclusion
All themes automatically include the ad area. The system has been integrated with:Positioning
The ad area is positioned right after the header in all themes for maximum visibility:html
{{module=header.html}}
{{include=ad-area.html}}
๐ฏ Customization
Modifying Ad Content
Editthemes/ad-area.html
to customize:Styling Customization
The ad area uses inline styles for consistency, but you can:Content Localization
Support multiple languages by creating localized versions:
themes/
โโโ ad-area.html # Default (English)
โโโ ad-area-es.html # Spanish
โโโ ad-area-fr.html # French
โโโ ad-area-de.html # German
๐งช Testing
Testing in Full Featured Mode
Testing in Hosting Service Mode
/admin
Testing Across Themes
Demo Page
Use the built-in demo page at/ad-demo
to test the feature.๐ง Troubleshooting
Common Issues
#### Ad Area Not Visible Problem: Ad area doesn't appear in hosting service mode
Solutions:
config/cms_mode.json
{{include=ad-area.html}}
{{#if isHostingServiceMode}}
#### Ad Area Always Visible Problem: Ad area appears even in full-featured mode
Solutions:
isHostingServiceMode
variable value#### Styling Issues Problem: Ad area doesn't match theme design
Solutions:
Debug Information
Add debug output to verify variables:html
Debug Info:
CMS Mode: full-featured
Is Hosting Service: false
Mode Name: Full Featured
๐ Advanced Features
A/B Testing
Implement different ad variations:html
{{#if isHostingServiceMode}}
{{#if themeOptions.adVariation}}
{{include=ad-area-variation-b.html}}
{{else}}
{{include=ad-area.html}}
{{/if}}
{{/if}}
Analytics Integration
Track ad performance:html
Dynamic Content
Load ad content dynamically:html
{{#if isHostingServiceMode}}
{{/if}}
User Preferences
Remember user ad preferences:html
๐ Related Documentation
๐ Getting Help
If you need assistance with the Ad Area System:
---
Happy advertising! ๐
This documentation is maintained by the FearlessCMS community. Last updated: January 2024