CSS link issue

Permalink
Hi All

I am having a senior moment, I have a new custom theme that I have installed on my XAMPP but for some reason when I try and look at it in C5 I don't see any CSS. I am guessing it is just not linking but I cant for the life of me see why, here is the link I am using.

<link href="<?=echo $ this->getThemePath()?>/style.css" rel="stylesheet" type="text/css" />

I have cleared the cache and tried variations of the link but I am getting nowhere fast.
Any suggestions or ideas greatly appreciated.

madeforspace
 
bcarone replied on at Permalink Reply
bcarone
Were you able to install the theme?

It needs to be in the sitemap/themes folder and installed via dashboard/pages_and_themes.

You prob did that :)

Is this a packaged theme or plain ole theme?
madeforspace replied on at Permalink Reply
madeforspace
Hi bcarone

The theme installed ok, its just when I look at the installed theme I don't see the CSS being applied.
It's a plain old, currently being built by me theme.
My old brain cells are hurting on this one as I have several C5 sites live and I am using the link above in them.
Any other thoughts on what could knock out the CSS?
12345j replied on at Permalink Reply
12345j
I've had this trouble as well when loading some converted themes css, don't know why. try loading css with this.
<link href="<?php      echo $this->getStyleSheet('style.css')?>" rel="stylesheet" type="text/css" media="screen" />
This worked for me for most of the themes.
or try
<link rel="stylesheet" media="screen" type="text/css" href="<?=$this->getStyleSheet('style.css')?>" />
madeforspace replied on at Permalink Reply
madeforspace
Thank you guys for both your suggestions but the problem remains.
I have now tried this out on my XAMPP and a live hosting package but with the same results. Each time the theme wont link to the CSS.
I am using a page with no extra code in so still the original HTML with out any editable areas but I do have the following code at the very top of my default.php
<?php   defined('C5_EXECUTE') or die(_("Access Denied.")); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php Loader::element('header_required'); ?>
<link href="<?php  echo $this->getStyleSheet('style.css')?>" rel="stylesheet" type="text/css" media="screen" />
</head>


This is the code suggested by 12345j and seems to me like it should work.

The CSS style sheet is called style.css and is in the same directory as the default.php.

I know I am going to find there is a glaringly obvious reason that is going to make me deeply embarrassed but I got to keep plugging away at this.

Update:
I loaded the page up to my dev account and think I have seen what is causing the problem. There seems to be an exta / appearing in the link to the CSS. I am a bit stuck now because I dont know how that extra / is getting in there.
madeforspace replied on at Permalink Reply
madeforspace
Oh the shame of it.
Problem fixed.
Hint for future people, dont use a theme name with either a space in it or capital letters, not sure which of those it was so I changed both.

Skulks away from the forum in shame.

Thanks again to the guys that took the time to answer.
Mnkras replied on at Permalink Reply
Mnkras
if the theme name is "Cool Stuff" the handle should be cool_stuff the controller (for packages) CoolStuff (caps are important)
Fernandos replied on at Permalink Reply
Fernandos
This is wrong:
<?=echo

This means echo already:
<?=
it's the short and lazy version of this
<?php echo


it should be
<link href="<?=$this->getThemePath()?>/style.css" rel="stylesheet" type="text/css" />


the default theme is using a different method to allow customization of the theme in the backend. here's the code
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('main.css')?>" />