- Posts: 5
- Thank you received: 0
Background images not showing
-
gposthumus
Inactive member - New Member
Less
More
11 years 7 months ago #29403
by gposthumus
Replied by gposthumus on topic Background images not showing
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
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.
-
ivan.milic
Support Staff - Moderator
Less
More
- Posts: 14116
- Thank you received: 1639
11 years 7 months ago - 11 years 7 months ago #29410
by ivan.milic
Replied by ivan.milic on topic Background images not showing
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.
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.
-
gposthumus
Inactive member - New Member
Less
More
- Posts: 5
- Thank you received: 0
11 years 7 months ago #29481
by gposthumus
Replied by gposthumus on topic Background images not showing
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.
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.
-
ivan.milic
Support Staff - Moderator
Less
More
- Posts: 14116
- Thank you received: 1639
11 years 7 months ago #29485
by ivan.milic
Replied by ivan.milic on topic Background images not showing
yes that is ok
Please Log in to join the conversation.
-
gposthumus
Inactive member - New Member
Less
More
- Posts: 5
- Thank you received: 0
11 years 7 months ago #29501
by gposthumus
Replied by gposthumus on topic Background images not showing
Thanks for confirming that, and for the great help !
Please Log in to join the conversation.
Time to create page: 0.095 seconds