Welcome Guest, Not a member yet? Register   Sign In
Help with planning a CI project
#31

[eluser]theprodigy[/eluser]
Code:
function aboutus($page="aboutus") {
    $this->pages($page); //no need to copy / paste the code, just call the function that has it
  }
#32

[eluser]theprodigy[/eluser]
that just makes sure that $page is always filled with something, even if you don't pass in a parameter. It defaults the $page parameter to "aboutus" if it would otherwise be null
#33

[eluser]invision[/eluser]
When I try to visit aboutus/ my SQL output is:

Code:
SELECT * FROM (`pages`) WHERE `slug` IS NULL LIMIT 1

Is this right?
#34

[eluser]theprodigy[/eluser]
did you change the aboutus method to what I put? It should default the $page variable to "aboutus" if you don't pass anything in.
#35

[eluser]invision[/eluser]
Oh, how would I change it?

Code:
function aboutus($page) {
    $this->pages($page);
  }
Is it a case of checking it the argument is NULL, and if so set it to index?

Sorry again for the hassle, you've helped out sooo much today.
#36

[eluser]theprodigy[/eluser]
check page 2, last post. You'll see a post with the method (all I changed was the parameter portion of it.

And since you are using the aboutus method, you really don't need the route we put into the routes page. I was only giving options of what you could do (one or the other), no need for both.
#37

[eluser]invision[/eluser]
Heh, just clocked your reply at #30. Sorry I missed it Sad
#38

[eluser]invision[/eluser]
Absolutely delighted with the help you've given sir.

Just a quick question.

Say if I wanted to list all the pages that are in the 'aboutus' section for my 'nav'.
How would I best do this?

Is it just a case of creating another controller to access all the pages, but limit it to the category_id value in my table?
So it would only list pages in the 'about us' section of the site?
#39

[eluser]theprodigy[/eluser]
that all depends on how you have your database setup.

When databasing the menu, I usually setup a table strictly for the menu, completely un-related to the other tables. So, if I wanted, I could build pages that can't be accessed via the menu (and vice versa if I'm not careful ;-) ).

You can do a google search for easy ways of databasing the menu and how to do recursive methods to pull all the data out that you need.
#40

[eluser]invision[/eluser]
Hehe, I know what you mean Smile
Cool, going to take a look at that shortly.

Totally chuffed getting the pages working, can't believe how quick it was too Smile You're a star.

In the meantime, I'm going to work on the navigation and news area of the site.

I may be back Big Grin


Thanks again!




Theme © iAndrew 2016 - Forum software by © MyBB