Welcome Guest, Not a member yet? Register   Sign In
Best ways to do stuff (several questions)
#1

[eluser]Bramme[/eluser]
Hey all

I'm starting on a new app (website for a non-profit organisation) but before I get to it, I'd like some feedback first. I've made a website or three, four now with CI and with every app, I feel I learn something. This has a down and upside. The upside offcourse being: aha! I've learned something. The downside is that I think "damn, if only I knew about this when I was making my previous app!"

Anyhoo, there's a few things that this site will need that I haven't done before, I'd like to ask if anyone has done smth like this before, or anybody has some tips.

1) So far I've always used one controller for the content and multiple for the backend. Though the amount of pages was always fixed and known. Now a serious amount of the pages will be stored in the database with the ability of deleting/adding new ones. There will also be some static pages that won't be stored in the db, like the home page will be a collection of latest news, events and a welcome message and the contact page won't be editable either.

2) This one concerns number 1. I guess I'll have to make a controller for the database pages and maybe a controller for the static pages (every static page being a method simply calling a view). Or I could make one controller for the content and use a _remap function...

3) Every main page will have a sidebar. The sidebar could have a subnavigation, some text or an image gallery, widgets if you like. How would I best manage these, store them in the db etc... I'm thinking of having a database table for each widget type and then a table that stores which pages has which widgets. Sounds good?

Thanks for bothering to read this!
#2

[eluser]pistolPete[/eluser]
In my CI application, I have a similar setup:
Some controllers serve special needs (e.g. a gallery, calendar, etc.), the rest is just "plain html" which is stored in the database.

For the html content, I use a single controller, called pages, which retrieves the data from the database.
I set up the following routes:
Code:
$route['default_controller'] = "pages";

// now add a route for the other controllers, e.g. :
$route["gallery(.*)"] = "gallery$1";
$route["calendar(.*)"] = "calendar$1";

// every request which ist not caught by the rules above, is routed to the pages controller
$route[':any'] = "pages";
#3

[eluser]Colin Williams[/eluser]
Not the answer you probably want to hear, but this just sounds like a CMS. Anything you think you need CodeIgniter for, specifically? Anything a CMS doesn't provide exactly the way you'd like?
#4

[eluser]Bramme[/eluser]
[quote author="Colin Williams" date="1225598242"]Not the answer you probably want to hear, but this just sounds like a CMS. Anything you think you need CodeIgniter for, specifically? Anything a CMS doesn't provide exactly the way you'd like?[/quote]Nothing indeed, except that I do this to learn from too.

Plus the people I'm doing this for are kind of computer analphabetics. The interface has to be as simple as possible. I'm afraid a cms will be too complicated/confusing for them to use because it might have too many options.

If EE2 was allready released I'd consider it, but untill then...
#5

[eluser]Pascal Kriete[/eluser]
Quote:If EE2 was allready released I’d consider it, but untill then…
What stops you from using EE as it is right now?
#6

[eluser]Bramme[/eluser]
[quote author="inparo" date="1225599758"]
Quote:If EE2 was allready released I’d consider it, but untill then…
What stops you from using EE as it is right now?[/quote]I'm afraid I won't be able to manipulate it as I want. Must admit I haven't really tried it out though. Might give it a whirl tomorrow...




Theme © iAndrew 2016 - Forum software by © MyBB