Link to home
Start Free TrialLog in
Avatar of Member_2_7970041
Member_2_7970041

asked on

Please explain this CSS

Hello!

I've noticed this code when I viewed page source:

<link rel="stylesheet" href="css:style.css" />

Open in new window


It doesn't make sense to me, 'cos it's NOT a valid URL to an external CSS file. The developer said something like this:
"It is reserved for the file > css/custom.css"

They also said:

The missing URL for the custom.css depends on the php code to include the css file.
If there is no css file to load, the code is blank"
>> layouts/theme.config.php

$this->addFile('css', 'css:custom.css');

Open in new window


I found this line of PHP code in template.config.php

$this['asset']->addFile('css', 'css:custom.css');

Open in new window

Avatar of Member_2_7974201
Member_2_7974201

Well at least it does not look harmful. It looks odd to me, too, but I do not use Joomla. Maybe this is how they do things.

Anyway - in your place - I'd look at the result. You know, browse to the page and use "show source code" in the browser to check what the html says it does.
The browser (or http://www.telerik.com/fiddler) will probably be able to tell you also, if you produce a HTTP 404 this way. And although we might understand or not understand the PHP - as long as the page itself runs...
Avatar of Julian Hansen
It looks odd to me, too, but I do not use Joomla. Maybe this is how they do things.
Except the author said
I've noticed this code when I viewed page source:
So this is after Joomla has finished in the process - this is the final output sent to the browser - and it is not valid.
One outside chance is there is some javascript that runs and modifies that link after page load but not sure I see the advantage.
I have overlooked that. Sorry. Julian is right.
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Member_2_7970041

ASKER

Thanks all of you for your replies!

At least, it's not harmful for the site (if I understood this part right). It's strange that serious commercial developers from Germany can't understand the wrong code. And when I brought it to their attention, they gave me that explanation, written above. Maybe they know something we don't.
Anyhow, if I have nothing to worry about, then I guess I could close this question.