The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Adding javascript to head of custom vbulletin powered page
Hi,
I created a custom vbulletin page that needs some javascript in the head tag in order for it to work properly. Can somebody please tell me how I can include the javascript in the <head> for this php script only? Thank you! |
#2
|
||||
|
||||
In your custom template, you can place code inside the head tags.
|
#3
|
|||
|
|||
Can you please tell me which template I want to edit? I checked out header and header includes but neither looked right. Thanks!
--------------- Added [DATE]1224701029[/DATE] at [TIME]1224701029[/TIME] --------------- Is it GENERIC_SHELL that I want? or maybe header include after all? |
#4
|
||||
|
||||
You said you created a custom page. So, what is the name of the template you created to use with that custom page?
|
#5
|
|||
|
|||
Thanks for responding, Lynne. I got it to work by adding the javascript that needed to go in the <head></head> tags to the headerinclude template.
However, it's now being put in every page when it is only needed in one. Do you know the conditional I can use to make the javascript only appear when i'm at that certain page? I think it's something like Code:
<if condition="is_script(MYSCRIPTNAME)"> blah... </if> |
#6
|
||||
|
||||
HTML Code:
<if condition="THIS_SCRIPT == 'yourpage'> blah... </if> |
#7
|
|||
|
|||
Thanks, Lynne. I defined THIS_SCRIPT as instructed by the "how to add vbulletin powered pages article".
It worked perfectly, thank you again! |
#8
|
||||
|
||||
Even though it will only display your JS code on your page, the condition is executed on every page (nothing on its own, but every little bit counts). The best solution would be creating your own template, and putting the code inside that template, instead of the current solution.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|