I'm loving the ScriptDeploy module however sometimes it's overkill. Now that the {cms_stylesheet} tag supports Smarty, put:
[[strip]] at the start and [[/strip]] at the end of your CSS file and guaranteed, your page will load more quickly!
Tip 2: My friend the Smarty replace modifier
Often in module templates things such as input field sizes, return pages, etc are dictated by the module action. Rather than change the action php code, I use, eg:
{$input_fieldname|replace:'size="80"':'size="40"'}
Returns the result I need without resorting to javascript, messing with CSS or tampering with the original module php files.
Tip 3: Using Smarty to 'test' for javascript
I had a page that was rather large and used jQuery UI tabs in the content. Problem was that for browsers that supported javascript, there was a visible jump between the page load and the $(document).ready stuff when the tabs kicked in.
Part of the solution was to add the 'accessibility' class to the content container div and remove it with jQuery when the page was ready. Worked well, the page literally flashed onto the screen already formatted. Problem was that browsers that did not support javascript would simply see the background. Solution was to add:
Code: Select all
{capture assign=accessibility}<__script__ type="text/javascript">var x = ' class="accessibility";return x;'{/capture}
In the content area:
Code: Select all
<div id="pagewrapper" {$accessibility}>
Code: Select all
$(document).ready(function(){
$('#pagewrapper').removeClass('accessibility');
});
HTH,
Cheers
psy