1
council
Mypage Document Inherits Xoops CSS-- I don't want that!
  • 2005/2/6 17:20

  • council

  • Not too shy to talk

  • Posts: 184

  • Since: 2004/12/18


Ok, I've got mypage working fine expect for one thing: the document is inherting the css from the XOOPS style sheet instead of the css I've got in the header of index.php.

How do I fix this?

Thanks,

Ric

2
tjnemez
Re: Mypage Document Inherits Xoops CSS-- I don't want that!
  • 2005/2/6 18:26

  • tjnemez

  • Home away from home

  • Posts: 1594

  • Since: 2003/9/21


can you provide a link?

3
JMorris
Re: Mypage Document Inherits Xoops CSS-- I don
  • 2005/2/6 18:51

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Use inline styles instead of specifying styles in the header of MyPage. Inline styles always override external stylesheets.

A perfect solution, no, but it will work.

Hope this helps.

4
tjnemez
Re: Mypage Document Inherits Xoops CSS-- I don
  • 2005/2/6 19:04

  • tjnemez

  • Home away from home

  • Posts: 1594

  • Since: 2003/9/21


index.php should look something like this:

<?php
include("../../mainfile.php");
include(XOOPS_ROOT_PATH."/header.php");
$xoopsOption['show_rblock'] = 0;
?>

your html with inline styling.

<?php
include(XOOPS_ROOT_PATH."/footer.php");
?>

5
rowdie
Re: Mypage Document Inherits Xoops CSS-- I don't want that!
  • 2005/2/6 19:24

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


Make a separate css file and place it in your 'mypage' module folder.

In your index.php file add this code somewhere after the include XOOPS_ROOT_PATH."/header.php" In the code use your module name, php file name and your css file name instead of what I've got here, of course

$xoopsTpl->assign("xoops_module_header""<link rel='stylesheet' type='text/css' href='" XOOPS_URL "/modules/mypage/mypage.css'/>");


I haven't tested it with 'mypage' but it should work, provided you have included the header.php file first.

This will add your css file after the xoops.css file. Css works on a hierarchal basis, so any classes and elements you have in your file will replace those in the XOOPS one, as long as they have the same name.

Rowd

6
tjnemez
Re: Mypage Document Inherits Xoops CSS-- I don't want that!
  • 2005/2/6 19:27

  • tjnemez

  • Home away from home

  • Posts: 1594

  • Since: 2003/9/21


i suppose, so you do not get confused, we should see what you have for code in your index.php

7
council
Re: Mypage Document Inherits Xoops CSS-- I don't want that!
  • 2005/2/6 20:57

  • council

  • Not too shy to talk

  • Posts: 184

  • Since: 2004/12/18


Quote:

rowdie wrote:
Make a separate css file and place it in your 'mypage' module folder.

In your index.php file add this code somewhere after the include XOOPS_ROOT_PATH."/header.php" In the code use your module name, php file name and your css file name instead of what I've got here, of course

$xoopsTpl->assign("xoops_module_header""<link rel='stylesheet' type='text/css' href='" XOOPS_URL "/modules/mypage/mypage.css'/>");


I haven't tested it with 'mypage' but it should work, provided you have included the header.php file first.

This will add your css file after the xoops.css file. Css works on a hierarchal basis, so any classes and elements you have in your file will replace those in the XOOPS one, as long as they have the same name.

Rowd



Thanks, Rowd, but it's a little confusing. Here's the include. Where do I stick your code above?

<?php
include("../../mainfile.php");
include(XOOPS_ROOT_PATH."/header.php");
$xoopsOption['show_rblock'] = 1;
?>


Ric

8
rowdie
Re: Mypage Document Inherits Xoops CSS-- I don't want that!
  • 2005/2/6 22:06

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


try this:

<?php
include("../../mainfile.php");
include(
XOOPS_ROOT_PATH."/header.php");
$xoopsOption['show_rblock'] = 1;
$xoopsTpl->assign("xoops_module_header""<link rel='stylesheet' type='text/css' href='" XOOPS_URL "/modules/mypage/mypage.css'/>");

?>

9
council
Re: Mypage Document Inherits Xoops CSS-- I don't want that!
  • 2005/2/6 23:20

  • council

  • Not too shy to talk

  • Posts: 184

  • Since: 2004/12/18


Quote:

rowdie wrote:
try this:

<?php
include("../../mainfile.php");
include(
XOOPS_ROOT_PATH."/header.php");
$xoopsOption['show_rblock'] = 1;
$xoopsTpl->assign("xoops_module_header""<link rel='stylesheet' type='text/css' href='" XOOPS_URL "/modules/mypage/mypage.css'/>");

?>



Tried it and got a blank white page. Was I supposed to add the url of the page somewhere. It's index.php

My url ishttp://blacklogs.com

Here's the code I pasted in after removing the orginal code:

<?php
include("../../mainfile.php");
include(XOOPS_ROOT_PATH."/header.php");
$xoopsOption['show_rblock'] = 1;
$xoopsTpl->assign("xoops_module_header", "<link rel='stylesheet' type='text/css' href='" . XOOPS_URL . "/modules/mypage/mypage.css'/>");

?>

Am I missing something?

Ric

10
rowdie
Re: Mypage Document Inherits Xoops CSS-- I don't want that!
  • 2005/2/7 0:04

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


I've just tested it with the mypage module as outlined in the XOOPS faq, and it does work so now we just need to work out why it's not working for you ...

In the code I pasted there were two parts that you needed to change to match your setup.

The first is the name of your css file. You should have made a css file, called it whatever you want, and put that name at the end of the code I pasted, replacing the 'mypage.css' with the actual name of your css file.

I made a quick css file just for testing, which I called mypage.css. This file is in the same folder that the index.php file is, for this module. It looks like this:
body {
background-color#009999;
}


That just gives the background a green colour, to show it's using this css file.

To make my code work you need to add the correct url for this file. If you changed the name of the mypage module folder, you need to use that name in the url. Same with the css file, you need to use the right name. The url is in the last part of the code snippet:

XOOPS_URL . "/modules/mypage/mypage.css'/>");

If you make sure the module name is right, and css file name is right, it should work exactly as I posted previously

So your index.php file for your mypage module should look like this (with the module name changed to your module name, and the css file name changed to your css file).


<?php
include("../../mainfile.php");
include(
XOOPS_ROOT_PATH."/header.php");
$xoopsOption['show_rblock'] = 1;

$xoopsTpl->assign("xoops_module_header""<link rel='stylesheet' type='text/css' href='" XOOPS_URL "/modules/[color=00CC33]yourMypageHere[/color]/[color=CC0000]YourCSSFileHere.css[/color]'/>");

?>


Let me know how you go...

Rowd

Login

Who's Online

153 user(s) are online (94 user(s) are browsing Support Forums)


Members: 0


Guests: 153


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