1
Sentalpin
put js codes between head tags
  • 2006/6/14 18:21

  • Sentalpin

  • Just popping in

  • Posts: 14

  • Since: 2005/5/15


hi xoopers,

i want to change mylinks module's singlelink.php page. i want to add some js codes to that page. i must add them between two head tags. but i can't put them there. :(


I try these:
- I put javascript codes in /includes/xoops.js But don't
- I put js codes in /modules/mylinks/templates/mylinks_singlelink.html pages as js codes . But don't
- I put js codes in /modules/mylinks/singlelink.php But don't


Where must i put the javascript codes to show them on only singlelink.php page?

2
leostotch
Re: put js codes between head tags
  • 2006/6/14 18:37

  • leostotch

  • Just popping in

  • Posts: 76

  • Since: 2006/4/1 1


I you're using XOOPS 2.0.14, you can add this on top of mylinks_singlelink.html:

<{$xoTheme->addScript('modules/mylinks/customfile.js')}>

or

<{
$xoTheme->addScript('','','window.alert("it works")')}>


If you change the module template directly, then don't forget to "update" the module in the modules admin afterward. However if you just want to do this for a site of yours, I think you should put all this in your theme instead:

- copy mylinks_singlelink.html to themes/yourtheme/modules/mylinks/mylinks_singlelink.html
- add your customfile.js file in this folder
- add the above code to the template copy

3
Sentalpin
Re: put js codes between head tags
  • 2006/6/14 20:03

  • Sentalpin

  • Just popping in

  • Posts: 14

  • Since: 2005/5/15


I'm using 2.0.14

i can't do. i paste to your code in /mylinks/templates/mylinks_singlelink.html
I see it works. But i dont see my codes works :)

I put there a customfile.js file and put my js codes in it. But it don't.



how can i make this?

Login

Who's Online

232 user(s) are online (101 user(s) are browsing Support Forums)


Members: 0


Guests: 232


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits