I'm currently working on a simple process where I've built a controller that lets me know if a person's browser is not running something comparable to the setup I'm putting together. If I go to http://example.com/useraction/index/checkbrowser
then the code will either return a commented line that reads <!--- GOOD TO GO --->
or it will return an image and link to encourage the user to upgrade their browser. I'm doing this through a controller that I have built because it does seem to work as is without all of that caching that Magento does. Let's face it, if I were to do this on the view (even though I would think of this as something that normally SHOULD be on the view) then the proper browser information would not return to the user.
With this in mind I have tried the following:
echo $this->getChildHtml('/useraction/index/checkbrowser');
echo $this->getChildHtml('/useraction/index/checkbrowser',false);
echo $this->getLayout()->createBlock('page/template')->setTemplate('/useraction/index/checkbrowser')->toHtml();
include('/useraction/index/checkbrowser');
None of this is working. What am I missing?
I think for the purpose of browser checking, Javascript would be best. You would include javascript in one of the template files, let says [yourthemes]/[yourmodule]/browser-check.phtml. Then you would add in your local.xml:
<default>
<reference name="footer">
<block type='core/template' name='browser.check' template="[yourthemes]/[yourmodule]/browser-check.phtml" />
</reference>
</default>
Then in your footer.phtml, you can echo the block out:
echo $this->getChildHtml('browser.check');
This will add that browser-check.phtml in every page, you might want to pop out a modal asking for browser upgrade perhap?