Page:
Get data from database
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
12
Get data from database
Robert Isoski edited this page 2019-12-07 16:26:04 +01:00
$Wcms->get()
- can be used to get data from database.js
- $Wcms->get('pages', 'PAGENAME')->PARAM;
- Param examples: title, content, keywords, description
WonderCMS 3.0.0 and above
Explanation of PAGENAME and PARAM and how they can be used:
- PAGENAME - name of the page you want to get data from. For this example, we will use the page about.
- PARAM - page parameter. Available page parameters (for pages) are:
- content
- example:
<?php echo $Wcms->get('pages', 'about')->content; ?>returns content for page about
- example:
- title
- example:
<?php echo $Wcms->get('pages', 'about')->title; ?>returns title for page about
- example:
- description
- example:
<?php echo $Wcms->get('pages', 'about')->description; ?>returns description for page about
- example:
- keywords
- example:
<?php echo $Wcms->get('pages', 'about')->keywords; ?>returns keywords for page about
- example:
- other PARAMs are available with plugins (such as additional contents)
- content
Get dynamic page content
<?php echo $Wcms->page('content'); ?>returns content for current page<?php echo $Wcms->page('title'); ?>returns title for current page<?php echo $Wcms->page('keywords'); ?>returns keywords for current page<?php echo $Wcms->page('description'); ?>returns description for current page
How to get other data (data unrelated to pages)
Getting other data using the Wcms get function $Wcms->get('config', 'PARAM'); (notice how the syntax is shorter than fetching page data shown above).
- Available PARAMs for config
- dbVersion
- example:
<?php echo $Wcms->('config', 'dbVersion'); ?>returns database version
- example:
- siteTitle
- example:
<?php echo $Wcms->('config', 'siteTitle'); ?>returns main website title
- example:
- theme
- example:
<?php echo $Wcms->('config', 'theme'); ?>returns current chosen theme
- example:
- defaultPage
- example:
<?php echo $Wcms->('config', 'defaultPage'); ?>returns the default home page
- example:
- login
- example:
<?php echo $Wcms->('config', 'login'); ?>returns the default login URL
- example:
- password
- example:
<?php echo $Wcms->('config', 'password'); ?>returns hashed password
- example:
- menuItems
- example:
<?php echo $Wcms->('config', 'menuItems'); ?>returns each menu item as list item<li><a href="//example.com/home">home</a></li>
- example:
- dbVersion
WonderCMS 2.7.0 and below
Explanation of PAGENAME and PARAM and how they can be used:
- PAGENAME - name of the page you want to get data from. For this example, we will use the page about.
- PARAM - page parameter. Available page parameters (for pages) are:
- content
- example:
<?php echo wCMS::get('pages', 'about')->content; ?>returns content for page about
- example:
- title
- example:
<?php echo wCMS::get('pages', 'about')->title; ?>returns title for page about
- example:
- description
- example:
<?php echo wCMS::get('pages', 'about')->description; ?>returns description for page about
- example:
- keywords
- example:
<?php echo wCMS::get('pages', 'about')->keywords; ?>returns keywords for page about
- example:
- other PARAMs are available with plugins (such as additional contents)
- content
Get dynamic page content
<?php echo wCMS::page('content'); ?>returns content for current page<?php echo wCMS::page('title'); ?>returns title for current page<?php echo wCMS::page('keywords'); ?>returns keywords for current page<?php echo wCMS::page('description'); ?>returns description for current page
How to get other data (data unrelated to pages)
Getting other data using the wCMS get function wCMS::get('config', 'PARAM'); (notice how the syntax is shorter than fetching page data shown above).
- Available PARAMs for config
- dbVersion
- example:
<?php echo wCMS::get('config', 'dbVersion'); ?>returns database version
- example:
- siteTitle
- example:
<?php echo wCMS::get('config', 'siteTitle'); ?>returns main website title
- example:
- theme
- example:
<?php echo wCMS::get('config', 'theme'); ?>returns current chosen theme
- example:
- defaultPage
- example:
<?php echo wCMS::get('config', 'defaultPage'); ?>returns the default home page
- example:
- login
- example:
<?php echo wCMS::get('config', 'login'); ?>returns the default login URL
- example:
- password
- example:
<?php echo wCMS::get('config', 'password'); ?>returns a hashed password
- example:
- menuItems
- example:
<?php echo wCMS::get('config', 'menuItems'); ?>returns each menu item as list item<li><a href="//example.com/home">home</a></li>
- example:
- dbVersion
Helpful links
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