I would like to put a script only into a specific page.

<?php if ( page is /node/1 ) { ?>
<!-- some script -->
<?php } ?>

The problem is I don't know how to construct the condition in the if-statement. What is the Drupal technique to determine which page you are at?

Comments

nevets’s picture

You probably want to use JS Injector

jirou_ueda’s picture

JS Injector had been tried before and did not read a script perfectly.
Therefore, I think that he would like to do by other methods.

jirou_ueda’s picture

javascript to actually put in is a thing of Twitter or Facebook.

Although there is no telling whether it is a factor that an external script is further contained in a script, even if it sets up by JS Injector, it does not work normally.

It is a script of Twitter.

<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>