Getting stylesheets to work in header.php and files associated with it

Let's say I created a header.php file in my includes folder.  And I include it in my index.php file in the site root directory.
Then in the header.php file, I have a link to the style sheet. 
The issue I've always found is that you can't get the header.php file to apply the stylesheet.
I can get it to work using global links, however I don't want to do that as I'll have to undo them before I upload the site.  (And I forget....)
So anyways, I came up with this code today in an attempt to overcome this.  Here is my header file so far:
"; } else           echo ""; ?>  
So here is what it is doing:
1. It is creating a variable called $directory which is equal to the current directory.
2. Then it is creating another variable called $currentFolder which is equal to whether or not the variable $directory contains the word "includes".
3. Then it says if $currentFolder is NOT false then it has the location of the stylesheet in relation to the header.php file.
4. Else - if it IS false then the stylesheet is located in a location in relation to files in my root directory.
This works perfectly fine....in Live view.  Both the header.php and index.php will format the header in live view.  Neither though will format it in Design view.  Which sucks cause I was pretty happy that I came up with this code on my own.
The reason it isn't working in Design View - I realize now - is because Dreamweaver won't process that script in Design View. 
Does anyone know of a way to get this script to run in Design View?  Or maybe some suggestions on editing this code to get it to work in Design View?
Thanks!

>The issue I've always found is that you can't get the header.php file to apply the stylesheet.
Right. That's because, and it seems you understand this already, the css file relative location is different from the point of view of the header file, and the parent file. Since the header file is included in the parent at the server, the client then sees the css file in the wrong location.
The solution is to use Design time style sheets. This will apply the css to the page only in design time - it won't actually insert the css file into the code. So, insert the css reference into the header file from the point of view of the parent - index.html. Then add a design time style sheet. That should work.

Similar Messages

  • How To Remove PHP Extension File Association With Internet Explorer

    When I select a PHP file to open it is redirected to be downloaded and opened (or I can choose to save) in Internet Explorer.  I need to test the file in different browsers.  How can I remove this automatic association?
    I've tried selecting a php file from Windows Explorer and selecting a different browser with no success.  I recently bought a new computer with Windows 8.  It's a big jump from my old one which used XP where there was no problem opening files with
    a php extension.
    Pat

    it sounds like you have a file association for .php, and, that you don't want to have one, so the original default behaviour would instead be preferable?
    This discussion, although for Win7, may be helpful:
    (the discussion occurs between "camelgrass" and "Brink")
    http://www.sevenforums.com/tutorials/19449-default-file-type-associations-restore.html#post259052
    Don
    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

  • Hey Guys. I have a 1st gen dual 2.3 powerPC G5. I just recently upgraded my OS to Leopard 10.5. I cannot for the life of me, get FlashPlayer to work. I Downloaded and installed the archived 10_1r102_64 version, but it still doesn't work. Help?

    Hey Guys. I have a 1st gen dual 2.3 powerPC G5. I just recently upgraded my OS to Leopard 10.5. I cannot for the life of me, get FlashPlayer to work. I Downloaded and installed the archived 10_1r102_64 version, but it still doesn't work.
    Everytime I click on a video it says I need to update to the newest version of flash, but my computer doesn't support the updated version. So I feel like I'm in a Catch-22. 
    Any suggestions?

    Jay, you may very well be up a creek without a paddle.
    See in each Browser which version of Flash it thinks it has...
    http://kb2.adobe.com/cps/155/tn_15507.html
    Then Test Adobe Shockwave & Flash Players...
    http://www.adobe.com/shockwave/welcome/
    If it in fact says you do have 10.1.102.64, & some sites say you need higher, it is a catch 22.

  • How do I get my webcam working on my skype and yahoo messenger, even though it is working well on photo booth?

    How do i get my webcam working on my skype and yahoo messenger, even though my cam is working on photo booth ( and i am tlking of the mbp with latest OX).

    you need to go into the preferences of the actual programs and make the proper settings...
    Such as in Yahoo, go to preferences, Webcam tab, sub tab Video and make sure you have the proper camera selected in the drop down menu of video source. In your case built-in isight camera.

  • HT2105 When you get a apple receipt for itunes songs and you paid with a itunes gift card do they charge you or give you store credit what's store credit is it good or bad or does it charge you if you have a free account with no credit cards at all is it

    When you get a apple receipt for itunes songs and you paid with a itunes gift card do they charge you or give you store credit what's store credit is it good or bad or does it charge you if you have a free account with no credit cards at all is it bad?

    iTunes credits are, for example, if you download a song from the store and it's found to be corrupt - if the track can't be fixed then iTunes support will tend to give you a song credit for a free download.
    When you purchase music from the store then any credits that you have will be used first, then any balance that you have (e.g. from iTunes gift cards or allowances), and any remaining amount will be taken from your credit card.

  • ForbiddenError: The server failed to authenticate the request. Verify that the certificate is valid and is associated with this subscription.

    Im trying to connect to my azure subscription via powershell on my machine but keep getting the following error when i run a command:
    ForbiddenError: The server failed to authenticate the request. Verify that the certificate is valid and is associated  with this subscription.
    The steps i have taken so far are:
    1. get settings file
    Get-AzurePublishSettingsFile
    2. Import settings file
    Import-AzurePublishSettingsFile -PublishSettingsFile "C:\Users\me\Downloads\credentials.publishsettings"
    3. I then run Get-Azuresubscription with the following output:
    SubscriptionId : 699385c3-b83a-44af-a651-bxxxxxxxxx
    SubscriptionName : Windows Azure MSDN - Visual Studio Premium
    Environment : AzureCloud
    SupportedModes : AzureServiceManagement
    DefaultAccount : 3B68902B5170D5EC91BFCBE4CC27E2A8838F61C4
    Accounts : {3B68902B5170D5EC91BFCBE4CC27E2A8838F61C4, 26B118D7F3C598FB8FE9CDC49AB5DE5E450C967C,
    03E1E1F0B8C7717F11FB58A14138C35524AB3F8D, 9A2E1FD267ECCC0E9B8C151BD931FC4824E89184...}
    IsDefault : True
    IsCurrent : True
    CurrentStorageAccountName :
    TenantId :
    I run Get-AzureAccount and get the following:
    Id Type Subscriptions Tenants
    3B68902B5170D5EC91BFCBE4CC27E2 Certificate 699385c3-b83a-44af-a651-xxxxxxxxx
    A8838F61C4
    26B118D7F3C598FB8FE9CDC49AB5DE Certificate 699385c3-b83a-44af-a651-xxxxxxxxx
    5E450C967C
    03E1E1F0B8C7717F11FB58A14138C3 Certificate 699385c3-b83a-44af-a651-xxxxxxxxx
    5524AB3F8D
    9A2E1FD267ECCC0E9B8C151BD931FC Certificate 699385c3-b83a-44af-a651-xxxxxxxxx
    4824E89184
    85AD02CB8EB8AB20CF2C44FD9D19F2 Certificate 699385c3-b83a-44af-a651-xxxxxxxxx
    9B6BB2FCD2
    Finally, when i try to run Get-AzureSQLDatabaseServer, to list my databases, i get this error:
    WARNING: Client Session Id: '5911f288-7b02-4c94-bb9d-37b9ea5fc187-2015-01-13 11:47:54Z'
    WARNING: Client Request Id: '3e5f7ea9-092a-46fd-a6a6-6916b9161b77-2015-01-13 15:25:41Z'
    Get-AzureSqlDatabaseServer : ForbiddenError: The server failed to authenticate the request. Verify that the certificate is valid and is associated
    with this subscription.
    At line:2 char:1
    + Get-AzureSqlDatabaseServer
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Get-AzureSqlDatabaseServer], CloudException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.SqlDatabase.Server.Cmdlet.GetAzureSqlDatabaseServer
    I would appreciate any help in figuring out what i am doing wrong here.
    Thanks,

    OK. That won't work in Azure Automation though, as mentioned above. OrgID (recommended) or cert-based auth will need to be used. PublishSettings file won't work.
    Correct, but the original question was:
    <Quote>
    Im trying to connect to my azure subscription
    via powershell on my machine 
    </Quote>
    I wanted to test automation script's core functionality without having to wait for the very very long time taken for an automation runbook
    to spin up, actually run and provide output (can often take 2+ minutes for a trivial script). Although i cant run Workbooks on my pc, i can run the core modules (view virtual machines, databases etc) to ensure my logic is sound.

  • Send to is not working when a document library is associated with work flow.

    Send to is not working when a document library is associated with work flow.
    question is when a workflow is tied to list send  to don't work ?
    we get a ntlm login prompt sphoradically, if we cancel the prompt we and reload the page we get the resultsen

    could you please give more detail about the issue?
    What kind of the workflow associated to the Library and what error you getting when trying to perform send to?
    check ULS logs...
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • Back to My Mac/VNC/Screen and File Sharing with a PC

    Ok back to my mac is great but it doesn't work with a pc. What is the best alternative to screen and file sharing with a PC???
    Thanks,

    Use VNC.
    On the PC.
    http://www.realvnc.com/products/free/4.1/index.html
    On the PocketPC
    http://www.windowsfordevices.com/news/NS5673359231.html
    Apple's Remote Desktop allows for VNC control through a password.
    iFelix

  • Is there a way to get around the pop up, "this device is already associated with an Apple ID. You can download past purchases on this device with just one Apple ID every 90 days. This device can be used with another Apple ID in 13 days."Someonehelp please

    Is there a way to get around the pop up, "this device is already associated with an Apple ID. You can download past purchases on this device with just one Apple ID every 90 days. This device can be used with another Apple ID in 13 days."Someonehelp please!

    What exactly are you trying to do?

  • When an iPad is connected to the MacBook And the option says it will make a full back of the iPad to the computer does that mean ALL the files associated with apps on the iPad? If so where is the backup located on the computer?

    When an iPad is connected to the MacBook and the option in iTunes says it will make a full back of the iPad to the computer does that mean ALL the files associated with ALL apps on the iPad? If so where is the backup located on the computer?

    Yes.  http://support.apple.com/kb/ht4946

  • Imessage not working on one of the phones associated with my account although imessage is turned on

    have imessage on but imessage not working on one of the iphones associated with my account

    The following may help http://support.apple.com/kb/ts2755

  • I can't seem to get  my iCloud working between my iPhone and iPad

    My wife and I recently purchased (in This order) an iPad, then 2 iPhones, then a second iPad. My iCloud on my devices is working fine. We are having trouble getting my wife's to work. I checked again, and was sure I had done what I was supposed to do to set hers up. She had her iPhone for a week or so before we got her iPad. We may have registered the phone with one Apple ID, and the pad with another. How can we get the two in sync?

    Hi
    So the problem we are working on is just your wife's iPhone nad iPad right?
    It sounds like you have a pretty good handle on the detailed screens.
    I think the key is to log out of your devices and then sign back in with only ONE ID on each device.
    Let's start with
    1. Settings
    2. Itunes and Apps stores
    3.  Tap on the Apple ID (willlook like your wife's id).
    4.  Tap sign out
    5.  Enter your preferred Apple id and password
    6.  Tap sign in
    7.  Check Settings> iCloud... should be the correct iCloud Id now (and greyed out)
    Do this on each device.....

  • Does anyone else have two Apple IDs? I can't get rid of one of them. It's associated with my iCloud account and I can't fix it. The password doesn't work.

    So, apparently I have two Apple IDs associated with my iPhone. One is an old aol address that got hacked and was shut down. Even aol doesn't recognize the email address anymore, and the password doesn't work. It's associated with my iCloud account, so now I can't access that account. My other Apple ID is with everything associated with my iPhone and everything works just fine. But now I can't get to my iCloud stuff. Has this ever happened to anyone else. The guy at the Apple store says he's never heard of it.

    Does the alert refer to "Local Items?"

  • I had all of my video files that I work on in iMovie saved to an external hard drive exclusively to save space on my Macbook.  I had just finalized a project, went to work on another one and files couldn't be found, were not deleted how do I find them?

    I had all of my video files that I work on in iMovie saved to an external hard drive exclusively to save space on my Macbook.  The other day I had just finalized a project and went to work on another one and when I opened the project I could see what should have been there, but scrolling over the entire clip I would only see black and that the file was missing.  I did not drag anything on the hard drive to the trash or move anything.  How can I get those files?  These are videos of my kids and I am devastated and willing to try anything!

    Control click does not work - no option to find files.  I have no idea what to do.  When I look at the usage of the external drive the space is being used, but I cannot find the files.  I am going to try MacKeeper's Undelete and see if I can make any progress with it. 

  • How can I set up my Mac Pro so that my wife and I can use our separate iTunes accounts? I keep getting an error message that the computer is already associated with an Apple ID even though the two accounts are associated with separate log ins!

    I'm getting very confused with setting up multiple user accounts on my Mac Pro for my wife and I. We each have a separate iTunes account, and we want to keep our music libraries seaprate. I've set up two user accounts on the Mac Pro and I have my iTunes authorised and logged into my user account on my user account. Under my wifes user account (i.e. a separate log in on the computer) I'm trying to set up her iTunes account, but I can't download or play anything from the cloud - it just says "This computer is already associated with another iTunes Account" and tells me that if I 'transfer' then I won't be able to use the other one for 90 days! This is really annoying as my wife can't access music she has purchased on her iTunes account on the home machine. We're not trying to do anything dodgy, just access our music on our own accounts on separate log ins on the same machine. Does anyone have any suggestions? Thanks!

    Hi Allan, thanks for that. I've already set up a log in for my wife and that is all working fine. The problem is that when she logs in and opens iTunes and trys to associate her library with her iTunes account she gets the error message "This computer is already associated with another iTunes account". Whilst this is true, the computer is associated with my iTunes account under my separate log in, which should have nothing to do with hers. If she transfers the association to her account it will lock me out of my content on my log in for 90 days - I'm trying to work out how to associate each of the log in accounts with a separate iTunes account so we can access our music independently of one another without locking each other out. Hope that makes sense!

Maybe you are looking for

  • I just got an ipad, and i can't get it to work. Can someone help me?

    Having a prob getting my ipad2 to start up.

  • Using imac as PS3 display

    Hi I was wondering if there is anyway i could use my imac 24 inch as a display for my PS3, possibly by means of HDMI. the imac is the june 2009 24" model with the 1920x1200 display. Thanks

  • WebI 3D bar graph doesnu00B4t look 3D in excel

    In Webi I created a vertical grouped bar chart and then I chose the Display option->  3d look.  The graph looks cool in WebI, it looks 3D as I expected, but when I export it to excel it doesn´t show 3D, it looks like if I didn't choose the 3D look op

  • Mail attachments appear embedded on PCs

    I've tried every diferent setting in mail. ALL my attachments now are embedded in mail emails to clients using Outlook on a PC. Previously, I had to use plain text but it would at least attach properly. C'mon Apple!!!!! Any ideas? Steve

  • Issue in starting Netweaver

    Hi All, I am using Netweaver version Netweaver CE 7.1 EHP1 installed in G:drive, got some issues with OS so i repaired the OS (Using windows repair option). After that when i am trying to start the SAP Management Console, repeatly getting the below m