CodeIgniter Forums
admin and user side templates - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: admin and user side templates (/showthread.php?tid=43155)



admin and user side templates - El Forum - 07-02-2011

[eluser]mysterious[/eluser]
I am developing a small project that has user and admin sides. In my controllers folder there are two folders admin and user. Similarly in my views folder there are two folders admin and user. Both admin and user ends have different templates. I have placed CSS/Images/JS in assets folder that is placed in root folder (parallel to system folder). I do not want to make two different folders in assets folder for admin and user. Instead what i want is to place respective css/js/images in views/admin and views/user folders. This way i can remove assets folder and all html/css/images etc will be in same folder and i will be able to make different themes for user side. Is it possible?? If yes how?? Please guide me in detail.


admin and user side templates - El Forum - 07-02-2011

[eluser]brucebat[/eluser]
Would you not just have something like this?

Code:
-header file

if ($this->session->user_data['account_type'] == 'Admin')
echo 'Your css style for admin here';

else
echo 'Your css style for user here':

Also try the url helper for the assets folder in one place?


admin and user side templates - El Forum - 07-02-2011

[eluser]mysterious[/eluser]
I want to place css , images, js in views folder. Is it possible ??


admin and user side templates - El Forum - 07-02-2011

[eluser]pmoroom[/eluser]
[quote author="mysterious" date="1309651996"]I want to place css , images, js in views folder. Is it possible ??[/quote]

Not sure why but of course it would work. What issues are you having?

For example assuming a css folder and a test.css file.

<link rel='stylesheet' type='text/css' media='all' href='/application/views/css/test.css' />


admin and user side templates - El Forum - 07-02-2011

[eluser]mysterious[/eluser]
i was getting directory forbidden or something like this. I have removed index.php from URL using .htaccess. Is it causing a problem??


admin and user side templates - El Forum - 07-02-2011

[eluser]pmoroom[/eluser]
[quote author="mysterious" date="1309653881"]i was getting directory forbidden or something like this. I have removed index.php from URL using .htaccess. Is it causing a problem??[/quote]
Code:
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]



admin and user side templates - El Forum - 07-02-2011

[eluser]InsiteFX[/eluser]
The .htaccess file in the application folder is your problem!

Deny from all

InsiteFX


admin and user side templates - El Forum - 07-04-2011

[eluser]mysterious[/eluser]
[quote author="InsiteFX" date="1309683053"]The .htaccess file in the application folder is your problem!

Deny from all

InsiteFX[/quote]

How do i fix it ??


admin and user side templates - El Forum - 07-04-2011

[eluser]InsiteFX[/eluser]
You either need to remove it or modify it! It's there to stop people from getting in to the application folder.

InsiteFX


admin and user side templates - El Forum - 07-04-2011

[eluser]mysterious[/eluser]
[quote author="InsiteFX" date="1309849106"]You either need to remove it or modify it! It's there to stop people from getting in to the application folder.

InsiteFX[/quote]


i have modified it and now i can access views directory. but is my application still safe? What security issues can arise now? is it a good practice to place all assets in views? or should i find a way to move views folder out of application??