Simple Machines Community Forum

Archived Boards and Threads... => Archived Boards => Joomla Bridge Support => Topic started by: vibez on January 31, 2006, 05:31:22 PM

Title: Why would the smf css need to be called in joomla when the forum is unwrapped?
Post by: vibez on January 31, 2006, 05:31:22 PM
Hi,

after a long few days playing with the bridge and template I have decided to have my forum unwrapped but designed to look like my joomla site.

I have come across one big problem. When the forum is unwrapped. My joomla site is still calling for the forums css file.

I think its due to this code I have to put into my joomla template file

echo '
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?beta4"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "', $settings['theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
var smf_scripturl = "', $scripturl, '";
var smf_session_id = "', $context['session_id'], '";
// ]]></script>';

echo '
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc1" />
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?beta4" media="print" />
<link rel="help" href="', $scripturl, '?action=help" target="_blank" />
<link rel="search" href="' . $scripturl . '?action=search" />
<link rel="contents" href="', $scripturl, '" />';


Ok, so when the forum is unwrapped, the forum only calls for the forums css file. But my main joomla site is actually calling for the joomla css file AND the forums css file. This is causing major problems as the forums css file is overriding any styles I set in my joomla css.

Why does joomla even need to see the forums css file if it is unwrapped?
Title: Re: Why would the smf css need to be called in joomla when the forum is unwrapped?
Post by: Kindred on January 31, 2006, 05:56:41 PM
obviously, it does not...

so, remove that line...
Title: Re: Why would the smf css need to be called in joomla when the forum is unwrappe
Post by: chadness on February 01, 2006, 10:14:03 AM
The problem is, even on the forum page, you will get the conflicting CSS.  Your best bet is to remove the duplicate code from your SMF theme's CSS file.  If you REALLY don't want any of that CSS on any other page, you could try doing something like:
Change:
echo '
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc1" />
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?beta4" media="print" />

to
if ($option = "com_smf") {
    echo '
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc1" />';
}
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?beta4" media="print" />

   
Title: Re: Why would the smf css need to be called in joomla when the forum is unwrappe
Post by: vibez on February 03, 2006, 04:28:24 AM
Quote from: Kindred on January 31, 2006, 05:56:41 PM
obviously, it does not...

so, remove that line...

I always thought that was the case. Maybe this should included in the readme? Thanks for confirming this :) My site is working fantastically now ;)

Quote from: chadness on February 01, 2006, 10:14:03 AM
The problem is, even on the forum page, you will get the conflicting CSS.  Your best bet is to remove the duplicate code from your SMF theme's CSS file.  If you REALLY don't want any of that CSS on any other page, you could try doing something like:
Change:
echo '
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc1" />
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?beta4" media="print" />

to
if ($option = "com_smf") {
    echo '
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc1" />';
}
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?beta4" media="print" />

   

Thanks, thats something to try out over the weekend :)
Title: Re: Why would the smf css need to be called in joomla when the forum is unwrappe
Post by: chadness on February 03, 2006, 10:04:59 AM
However, that's really only necessary if you will use it wrapped some times, so it may not be of any use to you.
Title: Re: Why would the smf css need to be called in joomla when the forum is unwrappe
Post by: vibez on February 03, 2006, 10:21:24 AM
I see. I really think that code should probably be in the readme. The code you posted seems more intelligent than the current code in the readme
Title: Re: Why would the smf css need to be called in joomla when the forum is unwrapped?
Post by: Kindred on February 03, 2006, 11:11:31 AM
I, however disagree...   we have enough people who are confused about that code that I don't think additional "if" statements would be useful overall.
Title: Re: Why would the smf css need to be called in joomla when the forum is unwrappe
Post by: chadness on February 03, 2006, 12:05:18 PM
It also might have a negative effect on things like the recent post module.  Definitely on the version of the discussbot that relies on the SMF CSS code.