Background images not showing

More
11 years 7 months ago #29403 by gposthumus
Hi Ivan...thx for getting back to me so quickly.

I placed your code in the template's index.php, but now receive the following error :

"Notice: Constant DS already defined in C:\wamp\www\test\templates\hot_wine\index.php on line 15".

My code from index.php :
...
/* The following line loads the MooTools JavaScript Library */
JHtml::_('behavior.framework', true);

define( 'YOURBASEPATH', dirname(__FILE__) );
define( 'DS', DIRECTORY_SEPARATOR );
$template_path = $this->baseurl.DS.'templates'.DS.$this->template;

$css_request = false;
...

Your suggestions ?

Thanks

Please Log in to join the conversation.

More
11 years 7 months ago - 11 years 7 months ago #29410 by ivan.milic
Try like this

if (!defined('DS')) {
define( 'DS', DIRECTORY_SEPARATOR );
}

and better move it to /css/template_css.php as first PHP code in file.
Last edit: 11 years 7 months ago by ivan.milic.

Please Log in to join the conversation.

More
11 years 7 months ago #29481 by gposthumus
Hi Ivan

Unfortunately that did not resolve the problem.

However, I discovered a "workaround" which seems to have solved the problem (but unsure if it's the correct way to solve it ?) :

** This is only for a Windows-hosted environment **

I placed the following code :

$template_path = str_replace(DIRECTORY_SEPARATOR, '/', $template_path);

in template's index.php, beneath the line...
$template_path = $this->baseurl.DS.'templates'.DS.$this->template;
...

All CSS styles and images now appear !

Please advise if it's OK to do it like this ?

Thanks for the help (and quick responses) as always....truly appreciated.

Please Log in to join the conversation.

More
11 years 7 months ago #29485 by ivan.milic
yes that is ok

Please Log in to join the conversation.

More
11 years 7 months ago #29501 by gposthumus
Thanks for confirming that, and for the great help !

Please Log in to join the conversation.

Time to create page: 0.095 seconds
Powered by Kunena Forum