PDA

View Full Version : PHP Include File Style Sheets no applying


JohnAdams
11-21-2012, 03:14 AM
New here and I am thankful I found this forum. I've been using dreamweaver since it was still Macromedia.

Lately I am designing php/css sites with a structure where I put recurring elements such as menu.php and header.php and footer.php in an includes folder. However, when I am working on those files, I do not have access to the css short cuts that are in the main files (from the Link href) that is placed in another head.php file. I am having to memorize my ids and classes while editing those include files and it is just adding tons of development time to a site.

Is there a way to get dreamweaver to pick these up short of putting link lines in every include php file?

<edit...forgot to say I am using CS5>

Ricky55
11-24-2012, 11:43 AM
Surely all your styles are linked to from your header.php file thats how I work anyway then I include the same header for every page in the site.

Conditionally loading assets when required and providing titles and meta descriptions using PHP depending on the page into which the header is being inserted.

Sure you might need to use certain classes and ID's throughout these include files but you shouldn't really have so many that you can't remember them.

Unless you have the memory of a goldfish my guess is that you are using too many ID's and Classes.

I also tend to write all my html all in one go then style it and then start to break it up into includes once I have the core of the styles coded just makes it easier.

Other than that you'll just need to keep having a peek at your files if you forget what you called something. Dreamweaver can't list the CSS if you are just in an independent include file as it doesn't know they exist.

Also try not to sure Dreamweaver's GUI to create styles. Its easier IMO to just code them by hand. I think an over reliance on Dreamweaver's GUI is what slows coding down.

Finally, be consistent across your sites that will help you to remember the names you've used and always describe what the item does rather than how it looks.

For example:

big-blue-button not great, call-to-action better.

HTH