![]() |
How to set this up? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: How to set this up? (/showthread.php?tid=14229) |
How to set this up? - El Forum - 12-23-2008 [eluser]jaswinder_rana[/eluser] Hi: i am planning on adding a feature to my site where users can select which template they want. What I am not sure about is where to put templates and directory structure? I could use include() statements and create it but I was hoping to stick with CI structure. Right now (if nothing works) then my plan was Code: -system Is that right way to go? Also, when users select templates, right now, they select it from drop down which is populated after reading templates directory in views. Is that right method or should I store template list in table? How to set this up? - El Forum - 12-24-2008 [eluser]jaswinder_rana[/eluser] Please anyone? How to set this up? - El Forum - 12-24-2008 [eluser]garrettheel[/eluser] in /views/ make a new folder for each new theme you want. Then, when you load pages, you can use $this->load->view($theme, 'page'); Otherwise, you could do this with the template library I posted.. http://ellislab.com/forums/viewthread/99892/ Code: $this->load->library('template'); How to set this up? - El Forum - 12-24-2008 [eluser]jaswinder_rana[/eluser] Thanks. And that library looks promising and easy to use. My main problem here is CSS and JS. I understand that they shouldn't be in views folder. So, it means I need to go with similar structure for them. I was hoping to avoid that and check if there's another solution but seems not. So far, after reading few threads, I have come up with following. Code: -system What I am trying to avoid is, having to copy views. In this case, my views will be same and only header and footer will change. So, it doesn't make sense to have views for all themes. But, I think there might be another way that your library can be used. - I can go with my method and then change themes But I can combine it with your template and have different output formats like Code: -system I can't (yet) see cons to this method. As you can see, just throwing the idea around has helped me enhance my original structure a bit. I just want someone to look at this and suggest if I am going the right way or not Thanks |