Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Magento grid layout

Posted on 2012-09-02
5
Medium Priority
?
662 Views
Last Modified: 2012-09-03
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...
0
Comment
Question by:rafique12
  • 3
  • 2
5 Comments
 
LVL 44

Expert Comment

by:Chris Stanyon
ID: 38358654
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.
0
 

Author Comment

by:rafique12
ID: 38358698
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

0
 
LVL 44

Expert Comment

by:Chris Stanyon
ID: 38358892
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.
0
 

Author Comment

by:rafique12
ID: 38359869
Yes that is just a test image and renders if I create static block and use static HTML.
0
 
LVL 44

Accepted Solution

by:
Chris Stanyon earned 2000 total points
ID: 38360209
In that case, change your block type, and add it to the CMS Design Layout Update XML
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Find out what you should include to make the best professional email signature for your organization.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
Suggested Courses
Course of the Month20 days, 17 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question