How did WonderCMS read and create a slug for each post?

Welcome to the WonderCMS community. Anything goes, except for support requests.
Post Reply
shoaiyb
Posts: 5
Joined: Sun Mar 14, 2021 11:14 am

How did WonderCMS read and create a slug for each post?

Post by shoaiyb »

I'm wondering how WonderCMS works
I wanna know how it read the database.js, find every available post, create a unique slug and make the post accessible through the slug.
User avatar
wiz
Admin
Posts: 576
Joined: Sat Oct 30, 2010 12:23 am

Re: How did WonderCMS read and create a slug for each post?

Post by wiz »

By default, WonderCMS includes a couple of pages like Home and Example.

1. Those pages are generated to database.js, once your WonderCMS website is first visited.
2. When you create a new page, for example via the menu
- we slugify the name and do a simple urlencode, and save the item to the database.js file.
3. All of the menu pages/slugs along with the content resides in database.js file.
4. If the page exists and your visitor requests that page, it will be served from the same database file.
hassan123322
Posts: 1
Joined: Wed Aug 04, 2021 8:47 pm

Re: How did WonderCMS read and create a slug for each post?

Post by hassan123322 »

i really like it its use full for me thanks
Post Reply