Editing Magento custom theme template files vs layout - magento

I’m fairly new to Magento themes and have been looking around for best practices for building them. I have an understanding of creating a skeleton structure for my theme and copying template files from the base theme. What I’m not sure of is, if for example I wanted to customise the product view, is it best practice to remove blocks from the view.phtml file or should I remove them in the layout file? I want a fairly simple product page with wishlist, compare, tags etc removed.
Many thanks in advance for your advice.

You need to remove from both from xml you will find handle catalog_product_view you need to remove code as well as you need to remove from view.phtml file in folder of your new theme. At the end your code will be cleared and will take less time to execute.

Related

get content of $this->getChildHtml('left')

I have installed sns nova theme for my site.
I need to know from where $this->getChildHtml('left') getting data. Inside same there is promotion slider. I need to reposition it to the bottom. Can anybody help me out to solve it?
you need to look on local.xml of your theme if it is correcly packaged, on the layout folder. Else search for left on the same folder to see where is the xml declaration. Once you found, you can check which blocks are called and the according template. I believe that your left child consist of many templates but I cannot be sure as I do not know the theme.

Magento products show up in all categories

I have a problem with products on my category-pages.
I've got 2 sub-categories, both with products. When I call the category-page of the first category, products from both categories show up.
When i turn the theme back to the default magento theme, only the products from the correct category show up.
I have already looked in the list.phtml file, but that's not it.
Got any idea's where to look? Thanks.
First check if there is a local.xml in your theme folder. The local.xml is used to apply specific changes without affecting the fallback system. Check the loca.xml for any specific changes to <"catalog_category_default"> , <"catalog_category_layered"> or <"default">.
If there is no local.xml in your theme folder you should check the catalog.xml.
You could open the catalog.xml from the default folder and open it next to the one you use in your theme. Then step by step check the differences.
Hope it helps!
I found the problem. For me the problem was in the 2columns-left.phtml file of my theme.
I compared it to the base 2columns-left.phtml file and saw some differences. Then is was easy to see which one it was and to fix it.

No horizontal navigation showing on Magento custom theme

I have decided to sit down and build my first custom theme in Magento and I'm using this tutorial: http://net.tutsplus.com/tutorials/php/magento-for-designers-part-4/
However I cant for the life of me find a way to include horizontal navigation (Home | Shop | Contact etc.) along the top of my website!
I tried all the suggestions I could find including placing everything in the root category and enabling all cats in the navigation.. refreshing the cache etc.
I've been working at this for hours now and been searching everywhere for an answer. I've pretty much followed the tutorial step by step but I can't see any way to enable the Nav - can someone please point me in the right direction with this?
(I'm kind of assuming Magento have a way to do this to add categories automatically - I'm aware I could hard code the navigation bar but I'm trying to avoid this.)
Looking at the screenshot on the tutorial, it doesn't actually have the menu anyway.
I'd recommend you check out leveluptuts magento theming tutorials, who actually take the base theme and manipulates it into the desired theme. I think you'll have much more luck that way as most of the templates and layout files are already built.
http://leveluptuts.com/tutorials/magento-community-tutorials/25-theming-magento-1-intro-theming
For the top menu, the default theme pages call the "header.phtml" template for the header block (app/design/frontend/base/default/template/page/html/header.phtml), which in turns calls the "topmenu.phtml" template (app/design/frontend/base/default/template/page/html/topmenu.phtml) where the menu code is.
The layout files is page.xml
Hope this helps!

Custom landing page with Octopress

I've setup Octopress and want to use totally custom styling basically throwing out most of the standard styling that applies to the rest of the site.
I do want to keep reference to all responsive goodness though that is baked in.
What's the best way to setup my custom landing page?
You mean like this?
http://eduncan911.com
^- My Octopress site.
Blog is at: http://eduncan911.com/blog
Since Octopress uses Jekyll under the skin, it would be better to think about how to accomplish this in terms of Jekyll - and there are many ways to do this.
OT: Personally, I find Octopress' theme layout, includes and customs far too complex and too granular. They did this to make it highly customable; but in my view, it tightly couples every template to another template.
Now with that said, there are multiple ways to achieve this. I did answer a very similar question here:
Creating an octopress theme from a wordpress theme
It's Jekyll: therefore, just go create the page however you want it. Replace the /source/index.html with whatever design, html and css you want.
If you don't want the blog roll, or want to move the "blog to another directory", just move the current /source/index.html to, say, /source/blog/index.html. That's it.
As I noted in the answer above, the only import thing is to keep the YAML frontmatter and specify the "layout" as you want to use. For example, I have a layout called "homepage" that is far different than any other layout. My /source/index.html uses layout: homepage.
But even then, you don't even have to use the YAML - create your own raw html file as you see fit. It will be used when you rake generate. This is what I personally did at first. Then, I slowly split up the homepage into the /source/_layouts/homepage.html and just went from there. I did not follow Octopress' entire theme at all - just enough to use posts and pages.

magento sub theme possible?

i'm creating a magento shop.
I've downloaded a new Template.
The template has an own "package" folder and has its phtml files in the "default" folder inside the package.
Now i begun to add a theme folder in this package to customize the downloaded template.
Everything is working fine.
But now i want to create sub-designs for this customized version, to make some shop-categories look different (I can change the theme for single categories in the backend).
is it possible?
what can you recommend?
I think Aoe_DesignFallback extension will help you http://www.fabrizio-branca.de/custom-design-fallbacks-in-magento.html
You can create as many theme variations as you want inside your custom package
package/default
package/theme1
package/theme2
...
package/themeN
Inside these themes you can customize as many files as you want. For example, you can edit only one specific template for on specific theme. Because of Magento fall-back mechanism all the rest files will be used from 'default' theme of your package and then from 'default' theme of 'base' package
Read this guide:
http://info.magento.com/rs/magentocommerce/images/MagentoDesignGuide.pdf
You need to make different designs for different categories, and at the backend,
Catalog > Manage Categories > for each categories > Custom Design Tab
You can select the design you want for that particular category.
You can also add something in Custom Layout Update as per your need.
You can even give time range that design will be shown and automatically display the default design after that time.
The only fallback mechanism for themes in Magento is between the supplied 'base' theme and your selected theme. That is, Magento will look for files in your selected theme, and, if any specific file is not found, will fallback to the supplied 'base' theme.
So, you can probably merge your desired theme with the 'base' theme, and replace the 'base' theme with this newly-created theme. Then, you can create one single sub-theme that can fallback on the new 'base' theme. I will not recommend you doing this, as this will make upgrading to new versions of Magento very difficult.
If you really want to make this work, I will recommend having a workflow outside of Magento to handle your files in the themes and sub-themes. Perhaps some sort of scripts that take files from the main theme and merge them into the sub-themes before copying all the themes and sub-themes folders into Magento.

Resources