Starting a Magento Theme

Posted by Trey on May 19, 2008

Duplicate these folders:

app/design/frontend/default/default
skin/frontend/default/default

(Don’t get me started about how awkward the folder structure is.)

Rename the duplicated folders to whatever you want (make them both the same).

FYI, the theme files under the app/ folder are for generated templates (things the system has to build when the site is viewed) and the theme files under the skin/ folder are for publicly viewable files (images, CSS, JavaScript).

Now go to your the admin area of your site and then System > Configuration. Then click Design in the sidebar and under Themes type the name of your theme folders (the ones you duplicated). Just once. One name.

Now the fun really begins. Time to dig into a bluemillion .phtml and .xml files. I’m still not too far along here, but I have determined that to change the media that you load in most pages, you need to edit:

app/design/frontend/default/your_theme_name/layout/page.xml

There you’ll se a bunch of crap like this:

<action method="addCss"><stylesheet>css/reset.css</stylesheet></action>

Have fun.

Changing the name of an app’s cookie in Rails

Posted by Trey on November 28, 2006

While running Tracks and another app on my localhost, I realized that every time I did something on one, it would log me out of the other. Overwriting each other’s cookies!

Add this line to your config/environment.rb:

ActionController::Base.session_options[:session_key] = ‘yourappnamehere_session_id’

Then restart the app. All better now.

Source