Link to home
Start Free TrialLog in
Avatar of rafique12
rafique12

asked on

Magento grid layout

Hi guys,

I hit a bit of a brickwall with my Magento development. I'm trying to create a simple area on the hompage where I can showcase any special offers etc and will need to tweak the layout I'm after something very similar to this: http://www.play.com/ (directly under the slider).

I have created a file called addboxes.phtml but am not sure if I also need to create a block in the local.xml file and reference addboxes.phtml from there?

Could someone please give me some advice please as I'm very stuck...
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

If you only want the addboxes.phtml to show on the homepage, then you need to add a block in the Design tab of the CMS page. Select CMS |Pages, choose your homepage and then click the Design Tab. In the Layout Update XML, you will need something like:

<reference name="content">
     <block type="core/template" name="homepage.boxes" template="addboxes.phtml" />
</reference>

Depending on the functionality you need in addboxes.phtml, you may need to change the block type. Also check the path to your template file.
Avatar of rafique12
rafique12

ASKER

Thankyou for your reply,

unfortunately I am not getting any content displayed. I added the following code to my homepage design area under Layout Update XML:

<reference name="content">
     <block type="catalog/addbox" name="catalog.addbox" template="catalog/addbox.phtml" />
</reference>

Open in new window


Here is a test from addbox.phtml
<div class="thumbnails"><img src="http://placehold.it/220x220"></div>

Open in new window

Couple of things.

In your XML you are creating a block with a class of catalog/addbox. Unless you've created this class yourself (or downloaded as plugin), it doesn't exist. Looking at the content of your template files you need to set this to core/template as in my previous example.

In your template file, are you sure that is a correct url for an image - http://placehold.it/220x220 doesn't look like an image.
Yes that is just a test image and renders if I create static block and use static HTML.
ASKER CERTIFIED SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial