Page:
Create custom page template
Pages
5 file structure
500 internal server error
Add SRI tags to your theme libraries
Add favicon
Additional security configuration(s)
All security features described
Allowed extensions file types for uploads
Always redirect to https and www
Apache2 configuration 404 page errors on Ubuntu LAMP
Backup all files
Better security mode (HTTPS and other features)
Caddy web server config
Change default login URL
Change default password
Create a plugin
Create custom page template
Create new editable areas or editable blocks
Create theme in 8 easy steps
Custom modules
Custom repositories
Default database.js
Demo
Download
Edit 404 page
Example of database.js
Get data from database
Hide page from menu
Home
IIS server config
Included libraries
List of all functions
List of common errors
List of hooks
Login URL doesn't work 404
Login
NGINX server config
One click update
One step install
Optional: functions.php file
Other errors
PHP built in server
Persistent "New WonderCMS update available" message
Recover login URL
Requirements
Reset password
Restore backup
Set data to database
Theme tags
Translations
URLs mailformed on Windows IIS
Update theme to work with WonderCMS 2.0.0
Update theme to work with WonderCMS 3.0.0
Update
[Self attack vulnerabilities] possibilities list
No results
5
Create custom page template
Robert Isoski edited this page 2022-10-09 21:40:38 +02:00
Table of Contents
- To create a custom page template you will need an extra file in your current theme directory with the new CSS file you want to apply.
- For example, if you want to have a custom theme for your page named
home, you need to create ahome.phpfile in your current theme directorythemes/yourTheme/home.php - If you want to create a custom theme for another page that you have named
example, the custom file will have to be namedexample.php
To make this easier, create a copy of your theme.php file and rename it to home.php or any other page that already exists (example.php)
- Replace CSS style with the one you wish to apply to the
homeorexamplepage and leave everything else as it, unless you also want to change the page structure.
IMPORTANT: Your custom page template will only load if your the page exists and if the slug is the same. Example slug: your-long-page slug will have to have a file named your-long-page.php in your currently active theme directory.
Solution 2 provided by ctuxboy
- This solution comes in handy if you need a custom page template for each employee.
- The thread with the provided solution can be found here: https://www.wondercms.com/community/viewtopic.php?p=7010#p7010
<?php
// get current $dir
$dir = pathinfo($Wcms->getCurrentPageUrl(), PATHINFO_DIRNAME);
$pattern = '/employees/';
// if 'employees' in the url => profile-page-layout ELSE default layout
if (preg_match($pattern, $dir)) {
echo 'EMPLOYEE PAGE!'; // add here your specific template/layout
} else {
echo 'DEFAULT PAGE!'; // default template/layout
}
?>
Intro
- Home
- Demo
- Download
- One step install
- Requirements
- 5 file structure
- List of hooks
- Included libraries
- Create theme in 8 easy steps
- Create a plugin
- Custom modules
- Translations
- All security features described
Basic how to's
- Backup all files
- Change default login URL
- Change default password
- Create custom page template
- Create new editable areas or editable blocks
- Edit 404 page
- Get data from database
- Set data to database
- Hide page from menu
- Caddy web server config
- IIS server config
- NGINX server config
- Login
- Recover login URL
- Reset password
- Restore backup
- Update
- PHP built in server
Themes
- Create theme in 8 easy steps
- Add favicon
- Theme tags
- Update theme to work with WonderCMS 2.0.0
- Update theme to work with WonderCMS 3.0.0
- Share your themes with Custom modules
Plugins
- Quick intro on creating plugins and List of hooks
- Share your plugin with simply with Custom modules
Security
- All security features described
- Add SRI tags to your theme libraries
- Always redirect to https and www
- Additional security configuration(s)
- Add SRI tags to your theme libraries
- Better security mode (HTTPS and other features)
Features description
- One click update
- Optional: functions.php file
- Default database.js
- Allowed extensions file types for uploads
- Login URL doesn't work - 404
- 500 internal server error
- Persistent "New WonderCMS update available" message
- URLs mailformed on Windows IIS
- Other errors
Still need help?
- Ask a question or make a request in the community.
- Official website