Install
$ agentstack add skill-macareuxdigital-concretecms-skills-building-singlepages ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Building Single Pages in Packages
Single pages are unique pages within a Concrete CMS site that are typically used for administrative dashboards, custom application logic, or specific landing pages that don't follow the standard page type/template system.
Creating a Single Page in a Package
1. File Structure
- Controller:
packages/your_package/controllers/single_page/your_page.php - View:
packages/your_package/single_pages/your_page.php
The path to the single page is relative to these directories. For example, for a page at /dashboard/my_module/settings:
- Controller:
packages/your_package/controllers/single_page/dashboard/my_module/settings.php - View:
packages/your_package/single_pages/dashboard/my_module/settings.php
2. Implementation
Controller
The controller should extend Concrete\Core\Page\Controller\DashboardPageController for dashboard pages, or Concrete\Core\Page\Controller\PageController for frontend pages.
app->make(PackageService::class);
$package = $packageService->getClass('your_package_handle');
if ($package) {
return $package->getFileConfig();
}
return null;
}
public function view()
{
$config = $this->getConfig();
$settingValue = $config->get('my_module.setting_key', 'default');
$this->set('settingValue', $settingValue);
}
public function save()
{
if (!$this->token->validate('save_settings')) {
$this->error->add($this->token->getErrorMessage());
}
if (!$this->error->has()) {
$config = $this->getConfig();
$config->save('my_module.setting_key', $this->post('settingValue'));
$this->flash('success', t('Settings saved successfully.'));
return $this->buildRedirect($this->action('view'));
}
$this->view();
}
}
View
The view is a standard PHP file. For dashboard pages, it's typically wrapped in the dashboard theme.
action('save') ?>">
output('save_settings') ?>
label('settingValue', t('My Setting')) ?>
text('settingValue', $settingValue) ?>
3. Installation
In your package controller's install() or upgrade() method:
use Concrete\Core\Page\Single as SinglePage;
public function install()
{
$pkg = parent::install();
$page = SinglePage::add('/dashboard/my_module/settings', $pkg);
if ($page) {
$page->update(['cName' => 'My Settings']);
}
return $pkg;
}
Best Practices
- Configuration: Use
$package->getFileConfig()to get a configuration repository specific to your package. This avoids prefixing all keys withpackage.your_package_handle.. - Security: Always use CSRF tokens (
$token->output(),$token->validate()) in forms. - Redirection: For parent dashboard pages that should just redirect to a child, use
$this->buildRedirectToFirstAccessibleChildPage()in theview()method of the parent controller and provide an empty view file. This approach ensures that the user is redirected only to a page they have permission to view.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: MacareuxDigital
- Source: MacareuxDigital/concretecms-skills
- License: MIT
- Homepage: https://forums.concretecms.org/t/proposal-community-maintained-skills-for-coding-agents-in-the-concrete-cms-ecosystem/9764
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.