0

I have added this below code for css reference.

JHTML::_('stylesheet', 'example.css', 'components/'._THISCOMPONENT.'/assets/css/');

It is working fine in local.But when i try to run it in the server, the css is not working due to this output html css link

<link rel="stylesheet" href="/components/com_fms/assets/css/css-3391b7d3949af1560b9927c0c3a672b2.php" type="text/css" />

Do anyone have idea on solving this issue?

2 Answers 2

1
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />

By default this code work correct if it is added in template-file (templates/my_fantastic_template/index.php)

Try this code:

$document =& JFactory::getDocument();
$document->addStyleSheet('components/'._THISCOMPONENT.'/assets/css/example.css');

I hope it will be helpfull.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the reply. But i am sorry, i have tried it and its not working. The problem is wherever the css extension files are all available, they are converted to temp file with php extension with out my knowledge.Is this due to template changes. Here is the similiar type of issue uk.answers.yahoo.com/question/index?qid=20070811044718AAsM3v8
0

Try using

<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />

instead

JHTML::_('stylesheet', 'example.css', 'components/'._THISCOMPONENT.'/assets/css/');

complet /templates/system/css/system.css with your url to the css file

1 Comment

Thanks for the quick reply. I have tried it , due to some macros the css extension is not rendering. Do you have any idea?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.