Jump to content

Help with the CMS tutorial


marlowe19

Recommended Posts

Dear Ben,

 

I would like to thank you for the wonderful lesson. I followd it, i'am now starting to customize it.

 

 

I need to add a feature that allows users to create a page. and let them choose if it is a parent or a child. Like wordpress does it.

 

Can you or anybody else help me

 

 

Thanks in advance,

 

 

Greetings,

 

 

Marlowe

Link to comment
Share on other sites

Glad to hear you found the series useful.

 

Personally, before you do any of this, I would at least consider using Wordpress with a shopping cart plugin or a similar Ecommerce/CMS platform. Don't re-invent the wheel if you don't have to.

 

In regards to your question, you'd need to have a "pages" table in your database which would contain all the information about each page, an ID value for each page (using a auto-incrementing key) and a column for specifying a parent page. Each page would have a numeric ID associated with it, and then you could specify if a child page had a parent page by specifying the parent page's id. For example:

 

Parent page:

ID: 1

Parent Page: --

Content: content here...

 

Child Page:

ID: 2

Parent Page: 1

Content: subpage content here...

 

I think the main challenge is not the initial setup of the table and indicating which pages are children or parents, but accessing the database and pulling all the right data to form a navigation structure. It will be a lot easier if you only have a parent/child relationship, but if you might have a multilevel structure where a parent page has children, and the children page also has children, it'll get a lot more complicated.

 

There's probably a lot more to it than that, but hopefully that will get you started?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...