Page 1 of 1

Editing database.js

Posted: Tue Jan 02, 2024 12:32 pm
by joseluis
Hi

I am new to WonderCMS and I like the structure and simplicity of this CMS.

I would like to know if it is possible to directly edit the database.js file to add new pages.

I am creating a website with many pages that will have the same content structure and I think it would be faster to duplicate the pages in the "database.js" file and then combine them with the WonderCMS editor.

Can I copy and paste the following code?

Code: Select all

        "inicio": {
            "title": "Inicio",
            "keywords": "Enter, page, keywords, for, search, engines",
            "description": "A page description is also good for search engines.",
            "content": "<h1>........",
            "subpages": {}      
      
      

Re: Editing database.js

Posted: Tue Jan 02, 2024 3:37 pm
by nox
Hi joseluis,
sure, here is a database.js example:
https://github.com/WonderCMS/wondercms/ ... atabase.js

You can add new pages or delete existing, set page order, visibility (menu items) and so on.
Create a backup just in case before editing database.

Re: Editing database.js

Posted: Fri Feb 16, 2024 6:18 pm
by NorfolkGreg
I looked at my database recently. I've deleted the call to the "subside" block from my theme.php but the "subside" block remains in the database.
There's also a "footer" block and a "header" block. I assume the latter was created when I tried to implement a functions.php.

A few questions follow...

I know that the guidance says I need to call the "header" block in the same way as the "subside" block , i.e.
<?= $Wcms->block('header') ?>

But how come, although it's in the "blocks" section of the database, that the footer is called with:
<?= $Wcms->footer() ?>
and not
<?= $Wcms->block('footer') ?>

And related to all this, is there any periodic automated deletion of redundant content of the database?
If I delete the "subside" block from the database, will WonderCMS issue error messages if I switch to a theme that calls the "subside" block, or does it just ignore something that's not there?