Answer the question
In order to leave comments, you need to log in
How to implement conditional comments for IE in Drupal 7 theme?
Hello. I ran into a problem that I can’t insert conditional comments into a Drupal 7 theme. I used to make sites on WordPress, there were no problems with this.
Pasted this code into html.tpl.php - doesn't work.
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
Answer the question
In order to leave comments, you need to log in
For a better browser detection, you can use this module , or rather the functions that it provides. Well, then through
or another hook that is responsible for generating the page, connect your script:
<?php
exampleModule_preprocess_html(&$variables){
if(условие){
drupal_add_js('путь до вашего скрипта');
}
}
;?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question