Set data to database

robiso edited this page Feb 22, 2018 · 2 revisions

wCMS::set()

  • can be used to save data to database.js

Examples

// Set new website title 
wCMS::set('config', 'siteTitle', 'My website title');
// Set current theme to "default"
wCMS::set('config', 'theme', 'default');

Additional examples

// Set title for "Page-name"
wCMS::set('pages', 'Page-name', 'title', 'Your title here');
// Set content for "Page-name"
wCMS::set('pages', 'Page-name', 'content', 'Page content here');
// Set SEO keywords for "Page-name"
wCMS::set('pages', 'Page-name', 'keywords', 'Page, keywords, here');
// Set SEO description for "Page-name"
wCMS::set('pages', 'Page-name', 'description', 'Page description for search engines.');

Helpful links

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.