views:

69

answers:

3

Hello,

I am looking to build a website that allows the user to fully customise the content that they see. I will be building this using CodeIgniter or Zend Framework and also jQuery. What I need to know and gain some advice on is how is the best way to create the content on the fly,

When a user selects that they would like the blog section to be on their website, I need to gather the blog information on the fly and print out the appropriate div on screen.

What would be the best way to do this? Would I be best creating the Div in the DOM or just calling a view onto the page?

A: 

In my opinion loading views would be a much easier and maintainable approach.

Imagining trying to do that in javascript gives me a headache.

Galen
A: 

My recommendation is don't. Don't re-invent the wheel. Choose an already available system like Drupal or Joomla.

If you really need to re-implement this because of a constrain you cannot tell us, then all I can say is that using JQuery is a damn good idea.

elcuco
A: 

One way is to create the dom objects on the fly using jQuery. This will work fine.

But another option would be to keep all your view logic in PHP and make a request to the server using jQuery, which will then return a snippet of html (a partial view). This would keep your code cleaner and your javascript files smaller and more manageable. Plus, whenever you make a change to your view, you won't have to do it in 2 places.

Adam Albrecht