1
tripmon
$xoops_module_header cache issues
  • 2006/5/15 13:43

  • tripmon

  • Module Developer

  • Posts: 462

  • Since: 2004/2/28


2.0.x & 2.2.X
I'm trying to assign module css and application/rss+xml via $xoops_module_header and running into what seems like a goofy issue.

1st, in non cached mode the module is valid xhtml, in cached mode.... well....

When assigning $xoops_module_header in my php file and not putting any reference to it in the .html template (which is listed in xoops_version.php & working fine) I get a properly inserted (in head) stylesheet. When running w/o cache enabled, this culminates in a lovely valid page.

Once I enable module wide cache, my style dissapears (due to the $xoops_module_header template assignment being called after header.php).

Of course this can be easily remedied by including
<{$xoops_module_header}>
in the .html template, but wait!

Now the (working, but misplaced) style sheet link appears in the body (not the head)and the page will of course not validate that way. In addition, inline notification checkboxes also turn xhtml uncompliant....but the page caches like a champ and displays properly.

Tried using a smarty postfilter which works in 2.2, but it seems to have a 2.0.X incompatibility.

Almost forgot, when NOT cached, With $xoops_module_header in the .html (smarty) template, the style sheet, and the rss feed link both load 2x (not a shocker, but just more info).

Seems like I'm missing something basic, but I can't figure out what...

If someone knows of a method to include a linked stylesheet and avoid the "cache OR compliant" issue, across webservers, please enlighten me.

Is there a correct way to have my cache and eat my xhtml too?

Thanks,
Trip

2
wizanda
Re: $xoops_module_header cache issues
  • 2006/5/15 14:57

  • wizanda

  • Home away from home

  • Posts: 1585

  • Since: 2004/3/21


With the Bible module I have just finnished, what I have done and also plan to do with Multimenu is.....
To call the style sheet from the top of XOOPS theme, making it everything in the page will call the style sheet as well as the XOOPS one..

Now while trying to figure this out I also learned that, with CSS if the same # or . is used then it uses the closet file to the project in question...
Also asking people to add something like that is simple for end users.
don't know if that is what you ment..just thought i would add it incase it helps... as i spent a day messing finding a way to insert a style into the body or any where with no hitches.
Other then that I don't have a clue, with the XOOPS cache system, yet.....

3
tripmon
Re: $xoops_module_header cache issues
  • 2006/5/15 16:02

  • tripmon

  • Module Developer

  • Posts: 462

  • Since: 2004/2/28


thanks wizanda, I don't want the users having to edit their theme files though.

Apparently 2.2 invokes a global $xoopsTpl (at least it seems to behave as though this is the case) which allows one to assign vars to the template ($xoopsTpl) before including header.php.

Does anyone know a workaround for 2.0.x that could be either used for both 2.0 & 2.2 or conditionally called?

Login

Who's Online

217 user(s) are online (120 user(s) are browsing Support Forums)


Members: 0


Guests: 217


more...

Donat-O-Meter

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

Latest GitHub Commits