0

I've picked up the task to modify a magento theme and I am already having huge headaches.

So, I'm simply trying to add a css to page.xml. The css gets included just fine, however, the base URL is off. My theme is rwd/default.

page.xml html output

What might be happening?

6
  • your url look like http://127.0.0.1/mrcare-magentoon your browser address bar ? Commented Jul 25, 2014 at 3:49
  • @programmer_rkt yes, just like that. I will get the same results for any page within magento realm. Commented Jul 25, 2014 at 3:52
  • how do you like to show this url in link href? Commented Jul 25, 2014 at 3:54
  • @programmer_rkt everything is right up to that point. A little bit further you will find rwd/default/css on the top two tags, however, on the one I included, it is base/default/css, while it should actually be rwd, just like the other two. Commented Jul 25, 2014 at 3:57
  • Check whether you have main.css file in the location skin/frontend/rwd/default/css/main.css ? You probably do not have that file there. But it exists in skin/frontend/base/default/css/main.css. Am I right ? Commented Jul 25, 2014 at 4:03

1 Answer 1

2

You set your default theme in rwd/default. Magento has a call back functionality built in for theme management. That means it will look for a file in package/theme directory that you have set through admin. (If you didn't set any custom theme, then the default package theme would be rwd/default for Magento 1.9 and default/default for <magento 1.9 ) If the file isn't found there, it will check for that file in base/default folder.

So in this case, this call back functionality would somewhat work like this.

  1. Browser requesting the url of css file to Magento.

  2. Magento accepts request. It looks which is the current theme being used.

  3. Magento recognizes current theme is rwd/theme. Bingo

  4. Magento genrates the url based upon theme. It would be skin/frontend/rwd/default/css/main.css

  5. Magento checks for that file there. Ooops !!! It is not there.

  6. Magento thinks then let us check this file in base/default. So it generates a url skin/frontend/base/default/css/main.css and looks file there.

  7. Urekaaa... File does exist. So magento includes this url for that css file

  8. If the file is not in there, Magento become "desperate" and will say to us "Sorry, I couldn't find the requested file anywhere."(literally). So shows a no-found error.

So what do you need to do is, copy your main.css file from skin/frontend/base/default/css/main.css to skin/frontend/rwd/default/css/main.css. That will do the trick

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.