Creating pages |
[eluser]Dizza[/eluser]
Hey everyone, I am new to codeigniter so thats probably why i ask this noobish question The thing is that i am making a CMS, i can add manage and delete posts. But i also want to add, delete and update pages through the CMS. So i make a page @ the cms and at the frontend there is a new menu item with the new webpage. Is there a library class for this? I searched everywhere but i cant find it. Thanks!
[eluser]harman[/eluser]
hi dizza, first you need to understand Ci URI structure e.g http://your-host/Controller/your_function/param1 for new post http://your-host/Controller/posts/newpost1 here 'posts()' is function and 'newpost1' its parameter Code: function posts(parameter){ Code: <a href=" http://your-host/Controller/posts/newpost1">new post</a>
[eluser]Dizza[/eluser]
Thank you, but this is just for posts right? This is the part that i already have. I want to know how to make pages. I think i need a framework, but how can i write/create a new page? Is this with the same structure as above?
[eluser]slowgary[/eluser]
What's the difference between a post and a page? Nothing?
[eluser]Caio Russo[/eluser]
hi dizza. Let's see with I understand your need: you have the controller: Code: function showPosts(){ and at your view you work with the array that now is called $posts. is that? Caio Russo
[eluser]Mischievous[/eluser]
Use a controller such as this: Code: <?php Then in your routes file inside your config directory set this up -> Code: $route[':any'] = 'page'; For your model run something like this: Code: <?php This code isn't tested and is only for demonstration purposes only... to simply point you in the right direction. Hope this helps you out some.
[eluser]srpurdy[/eluser]
This is designed to work with freakauth so, it's just an example of admin side controls pretty straight forward. You can also write a query in the model to just display your Page Names (titles) in a css designed menu pretty easly. This code is a bit old, but should get you in a decent direction. It's like everyone has said, it's not any different than making a blog post with info on it. I should mention I have my model auto loaded when ci runs, so you'll need too define that either at the top of the controller or autoload it. Controller Code: <?php Model Functions Code: //Page Admin
[eluser]Dizza[/eluser]
Hey all, thanks for the reply's! Im going to test a few of these solutions you gave. In the meanwhile i have found an example of what i mean with creating pages (not codeigniter): http://www.subdreamer.com/demo/admin/pages.php < here you can create a new webpage and also edit, update and delete it. This is what i meant with creating pages Im sorry if im not clear enough, english is not my main language.
|
Welcome Guest, Not a member yet? Register Sign In |