I’m experimenting with the Metro UI CSS framework to give a “Windows 8 look” to my website. So far it involves a lot of hand coding but I like the way it looks. However, while the CSS works I can’t get its JS scripts to run, even though FireBug tells me they’re loaded (in views/layouts/main.php). It seems that it requires jQuery to be loaded beforehand and because of Yii’s lazy loading I’ve had to force it by including an “invisible” zii widget, to no avail. Any ideas?
Thanks Andy, but I already tried that and it didn’t work… . There’s something in the JS loading mechanism that doesn’t allow the MetroUI scripts to run. I also tried loading jQuery/jQueryUI from Google, to no avail. Admitedly I’m no JS expert but this one has me stumped…
At the risk of sounding stupid, I learned PHP because of Yii, so I really haven’t tried without it because prior to that all I knew was MS Expression Web and all that sillyness… The problem shows up in views/site/index.php rendered with the views/layouts/main.php layout in a “testdrive”-type webapp; very light stuff. I’ll see if I can remember how to do a plain web page
Yes, I tried a custom scriptMap in config/main.php, even loading jQuery/JUI from directly from Google and not publishing assets or anything, to no avail.
I need to improve my skills…
Thanks guys, keep the ideas coming. If I can solve this perhaps I can contribute an extension á-la-Bootstrap by @cniska.
After a few days of rest I finally got it working… @andy_s, you were right; @ORey, I didn’t need your approach but I learned from it. To both of you, thanks!
One cannot use Yii’s smart lazy loading feature to load jQuery only upon the presence of a CJui widget; it must be directly loaded because none of the Metro UI widgets are Yii based.
One must load the scripts using CClientScript and not a <script> tag because they might get loaded in the wrong order.
The following views/layouts/main.php head section worked for me:
I know this is quite an old post but I was wondering if anyone can help. I’ve created a nice dashboard using emetrotile, and everything works fine. The only problem is that on a mobile device, the tiles keep their dimensions. Is it possible to make them responsive?