1
mwsmedia
Insert Javascript into theme.html?
  • 2004/11/22 23:22

  • mwsmedia

  • Just popping in

  • Posts: 6

  • Since: 2004/11/22


Hi -- my first XOOPS roadblock; hopefully you can help me crash through it.

I'm converting a site done in php-update to xoops. So far so good -- but there's a neat random quote javascript that I used to deliver quotes in a table cell on the old site, and I can't figure out how to do that in xoops.

I've tried hard-coding it, I've tried linking it to the script... help!

(I have tried searching the forums, but my own newbie ignorance may have prevented me from finding the answer...)

Thanks very much!

2
teibaz
Re: Insert Javascript into theme.html?
  • 2004/11/23 7:18

  • teibaz

  • Not too shy to talk

  • Posts: 103

  • Since: 2004/6/13


Why don't you want to write this into your <head></head>:

<script type="text/javascript">
<!--
<{
$xoops_url}>/quote.js
//-->
</script>


This works if your quote.js would be on the main directory (as 'mainfile.php', 'favicon.ico' and so on..)

3
carnuke
Re: Insert Javascript into theme.html?
  • 2004/11/23 11:25

  • carnuke

  • Home away from home

  • Posts: 1955

  • Since: 2003/11/5


You may also want to chaeck out the Random quote module.

Alos look at This thread

4
Mestophales
Re: Insert Javascript into theme.html?

My guess is you are trying to edit or modify the theme.html located in the theme folder. I have found that does nothing, you will need to modify the Name_of_Theme_theme.html in your xoops/html/templates_c directory in order to see the change.

This is how I have had to change or modify anything, and it works. If anyone else has a better way of doing it please share.

5
Mithrandir
Re: Insert Javascript into theme.html?

Close, Mestophales, but not quite there.

The file in templates_c directory is a compiled version of the theme's theme.html and as long as it is there, it will be used - however, it should not be edited manually.

Instead you should modify the theme.html in the themes folder and enable the "Update module templates from themes/yourtheme folder" in system admin -> preferences -> general settings as this will recompile the theme.html on every page load. When the theme is as you want it, disable the setting in system admin again for improved performance.

6
Mestophales
Re: Insert Javascript into theme.html?

Ah!!! That makes sense! Thanks!

7
mwsmedia
Re: Insert Javascript into theme.html?
  • 2004/11/24 6:42

  • mwsmedia

  • Just popping in

  • Posts: 6

  • Since: 2004/11/22


Thanks, everyone, for suggestions.

Here's where I'm at:

I've got a link to the script where I want it to appear in the page:

Quote:

<tr>
<td colspan="2" background="<{$xoops_imageurl}>quote_color.gif">
<script src="<{$xoops_url}>/quote.js"></script>
&nbsp;
</td>
</tr>


I've placed the script itself in the root directory of my XOOPS installation. Also, I've removed the <script> and </script> tags from the javascript file.

Still nothing!

Am I missing something basic?

Thanks again.

Login

Who's Online

155 user(s) are online (117 user(s) are browsing Support Forums)


Members: 0


Guests: 155


more...

Donat-O-Meter

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

Latest GitHub Commits