1
Sedoras
Moving Stuff to the <head> Part?
  • 2006/12/5 20:35

  • Sedoras

  • Just popping in

  • Posts: 5

  • Since: 2006/6/10


Hello,

is there any way to add stuff to the <head> within a module?
i.e. if i want to use a stylesheet or a <script> that is only used within that module?
I can just use echo '<link rel........' to put it in the <body> and that even works, but it does not feel right and does not look like proper HTML to me.

So, is there a way to add something within the <head> Tags?

2
preachur
Re: Moving Stuff to the Part?
  • 2006/12/6 0:11

  • preachur

  • Just can't stay away

  • Posts: 525

  • Since: 2006/2/4 4


You can use the theme changer module. It's kinda tricky... I had to rename my custom theme "default" and then set the theme included with the module as the default in the admin area.... Then it works.

Then you can assign modules different themes and even custom meta tags and page titles. You can also clone your default a few times, rename it, assign each module it's own version, and then have different javascripts, style sheets and stuff by editing the theme.html file for each module's theme.
Magick can never be restrained, but when freely given is thrice regained!

3
preachur
Re: Moving Stuff to the Part?
  • 2006/12/6 0:14

  • preachur

  • Just can't stay away

  • Posts: 525

  • Since: 2006/2/4 4


Magick can never be restrained, but when freely given is thrice regained!

4
banned
Re: Moving Stuff to the Part?
  • 2006/12/6 1:05

  • banned

  • Not too shy to talk

  • Posts: 159

  • Since: 2004/5/16


Quote:

Sedoras wrote:
Hello,

is there any way to add stuff to the <head> within a module?
i.e. if i want to use a stylesheet or a <script> that is only used within that module?
I can just use echo '<link rel........' to put it in the <body> and that even works, but it does not feel right and does not look like proper HTML to me.

So, is there a way to add something within the <head> Tags?


$xoopsmoduleheader :P

You can assign stuff to this smarty var wich is inserted in most of the 2.0 themes, before the <head> is closed with something like this, in your php code:
$xoopsTpl->assign('xoopsmoduleheader', $your_magic_stuff);

.. Or you can modify your theme and insert more template vars before <head> is being closed and assign stuff to them ..

Within 2.0.15 and up there are some other changes such a $xoTheme->addcss method.. but I've not read a properly named 'documentation' and I cannot be of help here.

banned,

Login

Who's Online

158 user(s) are online (115 user(s) are browsing Support Forums)


Members: 0


Guests: 158


more...

Donat-O-Meter

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

Latest GitHub Commits