Just like you can choose between coke or pepsi or between pizzahut or dominos It would sure be cool if we could choose our preffered css framework.
Currently bootstrap is hardcoded all over the place and in PR 1290 he wanted to move the hardcoding in to the aggregation, emps (another experienced mean developer) mentioned that having bootstrap available early on (before all of the aggregated css/js is loaded) will let us display the basics (layout/fonts) before aggregation is loaded and the rest cones in to place.
To achive this I need to “Ask” in the packages/core/system/server/views/incules/head.html what is the prefered cssFramework and to display the correct css in the head based on that configuration.
config to server view
So now I need to define a configuration value called cssFramework and to somehow get it to my serverside express routes I did this in a commit today and wanted to share…
- Define the value in configuration – I chose to put it in config/env/all.js because this value will probably be valid across all enfironments.
- Pass System to the rendered view in packages/core/system/server/routes.js
- Changed the controllers code to be able to accept a paramater (in this case it’s the config).
- Use the variable in your view (in this case just a comment).
Hope this helps people that want to use server side variables and configuration…