Welcome Guest, Not a member yet? Register   Sign In
template
#1

[eluser]bartgrrr[/eluser]
Hi,

When you use templates,

1. Would you create multiple templates when there's only a difference in css/javascript files?
2. Or would you add the css/javascript files by the controller?

What about css files surounded by a condition? (cfr. a browser condition)?

e.g.:
- a form page would link to a css files containing form element markup BUT a result page doesn't need this kind of css file.
- a page with charts needs to have a specific css file when the browser is IE9


Thanks in advance!
#2

[eluser]micfai[/eluser]
When the only difference is CSS/JS files, I would create a new template. This way would allow you to switch back and forth between templates without having to go in and modify every controller again if you need to switch templates.

With templates, you can do conditionals. I do a check with PHP for the browser and if it meets the requirements for a specific browser, I then load the corresponding CSS file.




Theme © iAndrew 2016 - Forum software by © MyBB