Issue linking CSS to backend Zend Framework 1 - php

I am working on a Zend Framework 1 application. It is successfully installed on my localhost and is working without any problems. However I've noticed that the css for the back end of the application is not working.
When I view the page source I can see the stylesheet has been loaded and can click on the link to it to view in the browser.
However the style is not applied to any of the elements on the screen and I do not understand why.
This is the layout file for the page: (adminstyle.css is not loading...)
<link href="/css/adminstyle.css" media="all" rel="stylesheet" type="text/css" title="default" />
<link rel="stylesheet" href="/css/smoothness/jquery-ui-1.10.2.custom.min.css">
<link rel="shortcut icon" href="images/favicon_2.ico" />
</head>
does anyone know what might be causing this issue? Apologies for the question if it seems stupid but I'm not really experienced with this sort of thing and I am trying to get to the bottom of it. Any help is much appreciated.
I can provide more details if required, I just do not want to post lots of unescessary snippets of code up.

Here is the right way to write links in zend framework cause with your way it will work just for the index/index , for other view you won't get the style css applied :
<link rel='stylesheet' type='text/css' href="<?php echo $this->baseUrl()."/css/style.css"; ?>" >
the same for your js files
hope it helps.

Related

CSS linking issues

i need some help with linking css to a php file.
This was completed by someone else and now i need to fix it. We have the main css that controls the look and feel of the entire site. The other CSS is just for the accordions page. that needs to be added in.
Current links include:
<!-- CSS Linking -->
<link href="css/template.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/accord.css" rel="stylesheet" type="text/css" />
If i remove the ?php echo from the second one it doesn't work, but if i leave it in there the css/template.css doesn't work.
Basically if both are in there are the same time they one doesn't work. Is there are way to resolve this?
The answer was that in the css of the second file there was an element of code that was overwriting the other file. The people had a body element. This has been removed and now both working together well.

WAMP + PHP CSS Include wont update with new styles

I am stumped. I am using includes to import a style sheet. If I add a new style to the style sheet, generated pages will not display ANY of the new css. If I change an old css rule it WILL display the change. I thought it might be a cached file of some kind, but I have cleared the cache in all testing browsers and the problem persists.
At first I thought it was a WAMP issue, but the problem happens when I move it all live as well so now I am thinking I am doing something wrong with the includes....
<link rel="stylesheet" type="text/css" href="css/foundation.css">
<!-- Included Custom Overides -->
<link rel="stylesheet" type="text/css" href="css/Custon_Foundation_Overides.css">
<!-- Supersizer CSS -->
And this is simply my include...
<?php require("Includes/HEADER.php"); ?>
Again, all the old CSS works fine, just any new additions to any of the style sheets will not display.
Thanks
<link rel="stylesheet" type="text/css" href="css/Custon_Foundation_Overides.css">
Maybe "Custon_Foundation_Overides.css" is a typo and you meant "Custom_Foundation_Overrides.css" or maybe you have to upload the file with correct letters capitalization.
Sounds like a browser cache issue. A simple way to fix this while maintaining good caching practices would be to pass the file make time as a query var to the file.
<link rel="stylesheet" type="text/css" href="css/foundation.css?ver=<?php echo filemtime('css/foundation.css');?>">
This will generate a string like:
<link rel="stylesheet" type="text/css" href="css/foundation.css?ver=1382564850">
This way when you update the file your browser will think its a new file and cache that, but as long as the file remains unchanged it will have the same name and maintain the browser cache.

Styles have disappeared despite being referenced correctly

Help!!! My worst nightmare has come true. My site is broken. It happened after attempting to install some PHP scripts to automatically minify and concatenate CSS and JS files. These were MISER and Minify. Each one created problems, so I took them out. Now none of the styles are showing, despite the fact that the CSS files are referenced properly. I had backed up the site prior to making these changes, but restoring the backup does nothing to fix the problem. Does anyone have any ideas? I am in crisis mode and nothing I do seems to fix the problem!
The following code is invalid:
<link rel="stylesheet" href="/themes/C5-LR/css/foundation.css'); ?>" />
<link rel="stylesheet" href="/themes/C5-LR/typography.css'); ?>" />
<link rel="stylesheet" href="/themes/C5-LR/css/main.css'); ?>" />
'); ?> should be removed in each link.
<link href="/themes/C5-LR/css/foundation.css'); ?>" rel="stylesheet">
<link href="/themes/C5-LR/typography.css'); ?>" rel="stylesheet">
<link href="/themes/C5-LR/css/main.css'); ?>" rel="stylesheet">
All these links are broken, remove ); and you should be good just like the above answer. You only need to reference those if you are using an
#import url('some-css-file.css');
instead of

Stylesheet not loading. URL duplicating on click

I have a big prob. We have a site that was working just fine but I was doing some fine tuning and somewhere along the line i messed things up. possibly in the .htaccess file.
My problem is that my css style sheet doesn't load nor do my images. ahh! They are all there.
I emptied my .htaccess file and deleted my robots.txt just to eliminate any blocking but that didn't fix it.
I validated my css file with The W3C CSS Validation Service and it said:
file not found: http://easybuildingproducts.ca/www.easybuildingproducts.ca/style.css
I feel like it has something to do with the fact that the URL is duplicated. It does that now when i click a link to any of my pages. It should be either or not both those links together. Is it possible a google cached my .htaccess or robots.txt when there was a potential redirect error? Is there a loop happening somewhere?
I was in the midst of making a custom 404 error page when this all went down.
www.easybuildingproducts.ca
Easy fix
<link href="www.easybuildingproducts.castyles/inside.css" rel="stylesheet" type="text/css">
That needs to be either one of the following
<link href="/styles/inside.css" rel="stylesheet" type="text/css">
or
<link href="http://www.easybuildingproducts.ca/styles/inside.css" rel="stylesheet" type="text/css">
I looked at the actual website source to find this example. there are quite a lot like it
Change the href to "/style.css" instead of writing your full domain out. Do the same kind of thing for all other resources that failed to load, too.
This will fix your problem, and it will also make your markup compatible if you decide to migrate to a different dsomain name in the future.
Your resources aren't being loaded (css, js, jquery, etc). Take a look at the screenshot taken from my Chrome Dev Tools > Sources tab:
This is because of your resources' file paths. It is definitely not a good idea to reference all of your resources with "www." in the file path.
Change
<link href="www.easybuildingproducts.castyle.css" rel="stylesheet" type="text/css" />
into
<link href="/castyle.css" rel="stylesheet" type="text/css" />

How do I override the default layout

I am new to PHP and today I was able to display my first list of items using CakePHP yay! but, whatever I display always shows with the default format. How can I override my view to show the page how I had it in html? Where do I put the css, javascript and images? Before this my HTML had this in the header
<link rel="stylesheet" href="css/stylestopmenu.css" type="text/css" />
<link rel="stylesheet" href="css/stylessidemenu.css" type="text/css" />
<link rel="stylesheet" href="css/jquery.rating.css" type="text/css" />
<link rel="stylesheet" href="css/specialtablemenu.css" type="text/css" />
<link rel="stylesheet" href="css/admintable.css" type="text/css" />
<script type="text/javascript" src="javascript/jquery.min.js"></script>
I have no idea how to style it so that it displays as before. Right now it shows like this
I wouldn't like to totally get rid of this as it tells me errors but, how can i do it so that I can style the page, maybe somewhere else?, please forgive me, I am new to PHP and its been hard for me to understand the tutorials. I would appreciate any help.
CakePHP lets you override pretty much anything, you just need to understand its structure. The best thing to do is to copy the default.ctp file from your cake folder in APP_DIR\cake\libs\view\layouts\default.ctp.
Once you've copied this, place it in APP_DIR\app\views\layouts\ and cake will start using that file. To customize it, simply open up that file and change it in your editor.
You need to define your custom layout in your controller to override default layout:
//in controller say in beforeFilter
function beforeFilter() {
parent::beforeFilter();
$this->layout = "your_layout_name";
}
Hope it helps

Categories