Greetings!
I created a page in dreamweaver with attached styles which was working just fine. Took the page and turned it into a template - which was also working fine.
Then applied the template to a page and styles are not showing at all.
Looking at the code my stylesheet is attached properly and uploading the page to a live server, the styles all display fine. It is just Dreamweavers is somehow not rendering the stylesheet.
I have double checked and ensured that the rendering of css is turned on. That the media is set to screen etc. Still I cannot get the CSS to render in design view.
As a temporary workaround, I can re-attach my stylesheet as a design time stylesheet and it renders just fine.
Anyone have any ideas what might be happening here? Is it a Dreamweaver cache issue?
Only thing I can think is that I do have some PHP code in the head section, but the page is a PHP page so that should not be an issue?
I would appreciate any help or ideas anyone can offer!
Thanks,
Martin
Hi Ken,
Thanks for your reply!
No it is not root relative.
Here is the CSS link in the template.
<link href="../Styles/960grid/text.css" rel="stylesheet" type="text/css" />
And here is how it appears inside the page
<link href="../Styles/960grid/text.css" rel="stylesheet" type="text/css" />
Which is a page in a folder, so this linking is correct.
Again, if I apply the same stylesheet in design time view, it works great. Otherwise the page shows as unstyled.
Thanks,
Martin
Hi Murray,
Thanks for replying to me! Here is the code in head of my file.
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- TemplateBeginEditable name="doctitle" -->
<title><?php echo WA_getCMSContent($database_PowerCMSConnection, $PowerCMSConnection, 'home', 'meta-title'); ?></title>
<meta name="description" content="<?php echo WA_getCMSContent($database_PowerCMSConnection, $PowerCMSConnection, 'home', 'meta-description'); ?>" />
<!-- TemplateEndEditable -->
<meta name="keywords" content="<?php echo WA_getCMSContent($database_PowerCMSConnection, $PowerCMSConnection, 'home', 'meta-keywords'); ?>" />
<?php require_once('../includes/meta.inc.php'); ?>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href="../Styles/960grid/text.css" rel="stylesheet" type="text/css" />
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="shortcut icon" href="../images/favicon.ico">
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png">
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
Personally I think it has something to do with the fact that I have some php in the head of the file. And as such this is breaking the styles in DW.
Thanks again for your help!
Martin
If I paste your code into a new PHP page, replacing the head content with your code, and then I click in the body of the page, when I look at the CSS panel, I see that it recognizes that "text.css" is attached to the page (even though it can't find the file at the linked location).
Message was edited by: Murray *ACP* to correct stylesheet name
Hi Murray,
I think what might have "broke" the template from working was that I had a database connection script in the template above the head section.
When I looked at the generated pages I saw the DW comments above the db connection code. I think this must be the issue.
Thanks again,
Martin
That would make no difference. PHP code is long gone by the time the browser gets the page. All that is delivered to the browser is the HTML, not the PHP. Now, if you are saying that somehow the link to the stylesheet wound up ABOVE the <html> tag, then yes, that would make a difference....
Hi Murray,
Yes of course it works fine in the browser as PHP is rendered prior to the delivery. What I am saying is that somehow DW is having a hard time interpreting having PHP code on a template page and when that template is applied to a page, it breaks the html style rendering.
As such, I am not getting any preview at all, no acknowledgement from DW that stylesheets are attached. The only way I can get a preview is to attach design time stylesheets to the page. Otherwise it is displayed as unrendered HTML in DW.
My thought is that is a DW cache issue?
Thanks again,Martin
What I am saying is that somehow DW is having a hard time interpreting having PHP code on a template page and when that template is applied to a page, it breaks the html style rendering.
This is surely not my experience, and I work with PHP and DW templates nearly 24x7. You do need to know that until you SAVE that newly created template child page, your style rendering *will* appear broken, and that's because DW has not yet adjusted the dependent file links because it doesn't know where the page is being saved - is that perhaps your issue?
Hi Murray,
I went in to my app data, roaming, adobe, dreamweaver cs6 and renamed my winfilecache.dat file to .old. Restarted Dreamweaver. Created a new page and viola everything is working as it should. I have seen this before in older versions of DW where the cache becomes corrupted and somehow DW cannot remember the links to the CSS files.
All fixed now!
Thanks again for your help!
Martin
Martin-
I am suddenly having the exact same issue, styles that displayed on dependent pages yesterday are nolonger displaying today- but the templates render with the styles, and everthing renders correctly in the browser. I cannot find the files that you reference above that fixed the problem. Can anyone help direct me?
thank you!
You need to turn on hidden folders to get into the ones he references.
Do a search in Google for "turn on hidden files and folders for (your OS )"
and you'll get quite a few pages telling you how to do it, if you don't already know. Once they are turned on, you'll be able to follow Snarky7D's reference.
Hi Dillon,
Here is a good guide on fixing the .dat corruption issue for either Mac or Windows.
http://www.webassist.com/support/documentation/how-tos/common_installa tion_issues.php
I hope it helps...
Best regards,
Martin
North America
Europe, Middle East and Africa
Asia Pacific