[LOW:TRACKER 6863:1.0.11] Adjust CSS path in file offline.php

Locked
fotisevangelou
Joomla! Ace
Joomla! Ace
Posts: 1421
Joined: Sun Jan 22, 2006 6:27 pm
Contact:

[LOW:TRACKER 6863:1.0.11] Adjust CSS path in file offline.php

Post by fotisevangelou » Mon Nov 20, 2006 10:37 am

Description:
The file offline.php does not have the $cur_template variable included in the CSS path. The variable exists higher but is not used in the html output. Instead this link is used:

Code: Select all

<link rel="stylesheet" href="<?php echo $mosConfig_live_site; ?>/templates/css/offline.css" type="text/css" />
Adding below that the current template's CSS link, it would ease the customization of the "Offline" page, only from the template's CSS file.

Reported on:
Joomla 1.0.11

Classification:
Low/Enhancement

Affected functions:
"Offline" page for Joomla!

Related files:
offline.php

Steps to replicate:
Enable offline mode for any Joomla! 1.0.11 website.

Analysis:
[Q&T] Confirmed

Proposed fix(es):
Add below the current CSS link this line of code:

Code: Select all

<link rel="stylesheet" href="<?php echo $mosConfig_live_site; ?>/templates/<?php echo $cur_template; ?>/css/template_css.css" type="text/css" />
Keeping the link to offline.css would serve as a backup, in case someone did not use a template_css.css file for their Joomla! website.

Topic / Artifact ID:
[USER] Enter the cross reference for topic or artifact id/url when submitted

System info:
Tested on several Windows machines, under AMP setup with PHP4 and MySQL 4 or 5.
Last edited by RobS on Thu Nov 23, 2006 1:29 am, edited 1 time in total.
Fotis Evangelou / JoomlaWorks

User avatar
Robin
Joomla! Master
Joomla! Master
Posts: 15753
Joined: Thu Aug 18, 2005 10:41 am

Re: Adjust CSS path in file offline.php

Post by Robin » Mon Nov 20, 2006 10:58 am

Q&T Note; Status > Under Review

User avatar
Robin
Joomla! Master
Joomla! Master
Posts: 15753
Joined: Thu Aug 18, 2005 10:41 am

Re: [LOW:UNDER REVIEW:1.0.11] Adjust CSS path in file offline.php

Post by Robin » Mon Nov 20, 2006 6:32 pm

Q&T Note; discussed by Rob and Robin, feedback has been requested by Dev.

User avatar
RobS
Joomla! Ace
Joomla! Ace
Posts: 1367
Joined: Mon Dec 05, 2005 10:17 am
Location: New Orleans, LA, USA
Contact:

Re: [LOW:UNDER REVIEW:1.0.11] Adjust CSS path in file offline.php

Post by RobS » Thu Nov 23, 2006 1:28 am

alright, the Devs seem to think it is okay if we include that tag but I only want to include it if the file exists so we don't have people's access logs being filled up with 404 errors. 

so, the revised change would be something like:

Code: Select all

if( file_exists( 'templates/' . $cur_template .'/css/template_css.css' ) ) {
     ?>    
     <link rel="stylesheet" href="<?php echo $mosConfig_live_site; ?>/templates/<?php echo $cur_template; ?>/css/template_css.css" type="text/css"/>
     <?php
}
Q&T Note; Added to the Tracker.  http://forge.joomla.org/sf/go/artf6863?nav=1
Last edited by RobS on Sun Nov 26, 2006 6:44 pm, edited 1 time in total.
Rob Schley - Open Source Matters
Webimagery - http://www.webimagery.net/ - Professional Consulting Services
JXtended - http://www.jxtended.com/ - Free and Commercial Joomla! Extensions

User avatar
absalom
Joomla! Ace
Joomla! Ace
Posts: 1199
Joined: Thu Aug 18, 2005 12:37 am
Location: Melbourne, Australia
Contact:

Re: [LOW:TRACKER 6863:1.0.11] Adjust CSS path in file offline.php

Post by absalom » Sun Nov 26, 2006 1:13 am

Possible code revision:

Code: Select all

if (!defined( '_ADMIN_OFFLINE' ) || defined( '_INSTALL_CHECK' )) {
	@include_once ('language/' . $mosConfig_lang . '.php' );
	
	// needed to seperate the ISO number from the language file constant _ISO
	$iso = split( '=', _ISO );
	?>
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo _LANGUAGE; ?>" lang="<?php echo _LANGUAGE; ?>">
	<head>
		<title><?php echo $mosConfig_sitename; ?> - Offline</title>
	<?php 
	if( file_exists( 'templates/' . $cur_template .'/css/template_css.css' ) ) {
    ?>
	<link rel="stylesheet" href="<?php echo $mosConfig_live_site; ?>/templates/<?php echo $cur_template; ?>/css/
	template_css.css" type="text/css"/>
	<?php 
	}
	?>
		<link rel="stylesheet" href="<?php echo $mosConfig_live_site; ?>/templates/css/offline.css" type="text/css" />
By disambiguating it from being set to rhuk_solarflare_ii, it means it will grab the appropriate styles from the relevant template and then style with offline.css. It also deals with the XML prolog issue that's been affecting frontend and backend rendering via quirks mode.
Design with integrity : Web accessible solutions
http://www.absalom.biz
http://twitter.com/absalomedia

User avatar
Robin
Joomla! Master
Joomla! Master
Posts: 15753
Joined: Thu Aug 18, 2005 10:41 am

Re: [LOW:TRACKER 6863:1.0.11] Adjust CSS path in file offline.php

Post by Robin » Wed Nov 29, 2006 7:46 pm

Q&T Note; fixed for next release

User avatar
RobS
Joomla! Ace
Joomla! Ace
Posts: 1367
Joined: Mon Dec 05, 2005 10:17 am
Location: New Orleans, LA, USA
Contact:

Re: [LOW:TRACKER 6863:1.0.11] Adjust CSS path in file offline.php

Post by RobS » Thu Dec 07, 2006 1:30 am

As a final note on this one, I changed the css file to offline.css as there were style conflicts with using template_css.css.  So, now the offline.php will include templates/css/offline.css and if present, templates/$current_template/css/offline.css
Rob Schley - Open Source Matters
Webimagery - http://www.webimagery.net/ - Professional Consulting Services
JXtended - http://www.jxtended.com/ - Free and Commercial Joomla! Extensions

User avatar
absalom
Joomla! Ace
Joomla! Ace
Posts: 1199
Joined: Thu Aug 18, 2005 12:37 am
Location: Melbourne, Australia
Contact:

Re: [LOW:TRACKER 6863:1.0.11] Adjust CSS path in file offline.php

Post by absalom » Thu Dec 07, 2006 3:20 am

RobS wrote: As a final note on this one, I changed the css file to offline.css as there were style conflicts with using template_css.css.  So, now the offline.php will include templates/css/offline.css and if present, templates/$current_template/css/offline.css
Probably not the best path to take.. CSS allows precedence and if you want your 'offline' status styled in the same way as your 'online' templates, the only problem therefore will be potential malformedness on part of the initial offline.css file / offline template design.

So it's not the template_css.css file at fault, but the way the offline effect is delivered.
Design with integrity : Web accessible solutions
http://www.absalom.biz
http://twitter.com/absalomedia


Locked

Return to “Q&T 1.0.x Resolved - Archived”