开发者

HTML for FireFox

开发者 https://www.devze.com 2023-01-22 09:08 出处:网络
I am working with Joomla. I would like to display a certain module if the user has all browsers, except FireFox, and display another module if user has FireFox browser. I know that I can do targeted b

I am working with Joomla. I would like to display a certain module if the user has all browsers, except FireFox, and display another module if user has FireFox browser. I know that I can do targeted browser CSS styling, but in my case I need the user's browser to choose between an excerpt of HTML code (for all browsers choose this module, for FireFox choose the other module). Since for CSS browser targetting we simply add the @-moz-document url-prefix() { .selector { style... } }, I am hoping there is a simple HTML line that is analogous to be used in the HTML file to render either one line of code, or another line of code based on the browser's engine. I fear I am not communicating clearly. Any help would be great.

Thanks, 开发者_运维知识库


Perhaps this Joomla extension is what you're looking for:
http://extensions.joomla.org/extensions/style-a-design/templating/11833


I don't know joomla supports any attribute for module calling in template. You can try with following code:

<?php 
if(stripos($_SERVER['HTTP_USER_AGENT'], 'firefox') === false) {
   echo '<jdoc:include type="modules" name="other_module" style="xhtml" />';
}else{
   echo '<jdoc:include type="modules" name="firefox_module" style="round_box" />';
}
?>
0

精彩评论

暂无评论...
验证码 换一张
取 消