Archive for 'Design'

Adding and removing javascript / css when and where you need it

Posted on 18. Feb, 2009 by Fido.

0

Adding and removing javascript and css is handled separately within Magento. CSS is added in the usual fashion, where you have a <link rel="stylesheet"... />. However, any included javascript (unless linked to "by hand" from a theme's skin) is pulled via a php files which reads through the "js" folder in the root directory (root/js/index.php is responsible for this). That is all well and good for Magento. The real question is how we, as developers, add these items when we need them. How you as a developer add css or javascript is, luckily, handled the same. In this post, we will show how to add and remove javascript and css to a CMS page (and anywhere else) that you may need.

Continue Reading

What’s in a block? - Some Magento “basics”

Posted on 22. Jan, 2009 by Fido.

4

Many developers are familiar with the MVC (Model View Controller) design pattern that is seemingly ubiquitous throughout web frameworks. Looking through the code in Magento, however, we see many other components besides the M's the V's and the C's. Each module (a "module" meaning the separate directories within the "app/code/core/Mage" directory that comprise of Magento's different functional areas) contains the usual Controller and Model. You'll see that within each module, there are no Views (more on this later). You'll also see extra tidbits, such as "helper" , "etc" and "sql". These are (and are not) standard within the Zend Framework context and will not be discussed in this article. In these modules are also the sort of files which we work with very often. The all powerful block! This article will attempt to (hopefully accurately) describe just what a Block is and how it's used.

Continue Reading

How to override a Magento core block class

Posted on 17. Sep, 2008 by Fido.

13

This tutorial will show you the proper method for overriding a Mage core class. This will work for Block and Model classes. Controllers are a slightly different story and for another tutorial. Some discussion on breadcrumbs: I will be overriding the Core file: app/code/core/Mage/Catalog/Block/Breadcrumbs.php (which I will call [Breadcrumbs-B]). This file is not to be confused with the block: app/code/core/Mage/Page/Block/Html/Breadcrumbs.php (which I will call [Breadcrumbs-A]).

Continue Reading

How to fix the Magento Out of stock bug, version 1.1.x

Posted on 05. Sep, 2008 by Fido.

5

This is a popular bug that has been plaguing many people with their custom Magento solutions. Problem: Magento shows products that are in stock as "Out of Stock" - It seems to be popularly reported within the New Product block.

Continue Reading

Editing the Magento Navigation

Posted on 04. Sep, 2008 by Fido.

2

This is not a comprehensive example (I didn't write out an example of editing the navigation myself ... yet) - but I will point out where the files are that you need to edit the top and left navigation.

Continue Reading

Moving / Removing Callouts on the left / right columns

Posted on 03. Sep, 2008 by Fido.

13

I recently answered a question on the magento forums about how to remove the callout images in the right / left columns. This is a pretty easy task, but finding them required a small bit of digging (as usual).

Continue Reading

Editing the Footer in a stock magento build

Posted on 02. Sep, 2008 by Fido.

4

The items in the footer area are in two different locations. One part is a static block created within the magento admin area (CMS > Static Block). The other part is held in the related .phtml / .php / .xml files within the design files. First off, the XML files...

Continue Reading

Move mini-cart in the sidebar to the header (or anywhere) in Magento

Posted on 29. Aug, 2008 by Fido.

7

Hi all - Here is my solution to a question I've seen asked many times: How to move the cart sidebar into the header area. You can use this technique to move it anywhere. This is not the only way to do this, but it is a useful one.

Continue Reading