magento how do i create specific home page for specific templates - magento

I have a good design on my website and i suddenly realized my design does not render pretty well in internet explorer 7 and 8, i tried all that i can but i still cannot fix it and i dont like how its displaying in those browsers so i decided to add exception on the design configuration coumn by adding MSIE 7.0 and then value of defaul, tested with internet explorer 7 and it works well but my problem is that my custom theme has some large images and texts and other materials that were aligned nicely with css but once i changed the theme to default and it does not see those css, they also just display anyhow and its really a pain for me, all that i need to do now is find a way to make the default theme load with a different cms page instead of the normal homepage for my main theme. i dont know if i can do that but i need some little help or guide to go about it.
I followed your guide and have created the files and now i can see the welspot template under the design field.
Now i need to still use the old homepage (the one i have installed with the hellowired theme), i want to copy magento default theme into my package now and edit it but i need to find a way to remove all the static blocks i created through maybe a layout file as i wont use those blocks in the default theme and even if possible add different images through xml so i would be using two themes with the same homepage but dynamic content based on the theme being used.

Sure, you can set default home page whatever you create but you should do some things.
First, create config.xml
<!-- path: app/code/local/Welspot/Page/etc/config.xml -->
<?xml version="1.0" encoding="utf-8"?>
<config>
<modules>
<Welspot_Page>
<version>0.1.0</version>
</Welspot_Page>
</modules>
<global>
<page>
<layouts>
<welspot_one_column_cms module="page" translate="label">
<label>Welspot One Column</label>
<template>page/welspot_one_column.phtml</template>
<layout_handle>welspot_one_column_cms</layout_handle>
</welspot_one_column_cms>
</layouts>
</page>
</global>
</config>
Second, create Welspot_Page.xml
<!-- path : /app/etc/modules -->
<?xml version="1.0"?>
<config>
<modules>
<Welspot_Page>
<active>true</active>
<codePool>local</codePool>
</Welspot_Page>
</modules>
</config>
Third, create welspot_one_column.phtml
<!-- path : /app/design/frontend/[your_package]/[your_theme]/template/page -->
<div>Hello World</div>
As you might guess, you should customize welspot_one_column.phtml file.
Finally, go to Admin > CMS > Pages > Home Page > Design Tab select your newly created template (Welspot One Column).

Related

Magento Custom Page Layouts Not Appearing in Dropdown Menu

I'm attempting to create a custom page layout for a Magento site I'm building, but having the most difficult time in the world getting the template to actually appear in the dropdown menu when I create a page. I've tried repeatedly, using different sources, to get this to work, and have no idea where to go from here.
The most annoying part of this is that it works just fine on my local copy of Magento. When I move the exact same code to my remote hosting, however, it no longer shows up in the list.
Here's an example of one of the layouts I've tried to create:
/app/code/local/custom/layouts/etc/config.xml:
<?xml version="1.0"?>
<config>
<modules>
<custom_layouts>
<version>0.1.0</version>
</custom_layouts>
</modules>
<global>
<page>
<layouts>
<home_page_layout module="page" translate="label">
<label>Home Page Layout</label>
<template>page/home-layout.phtml</template>
</home_page_layout>
</layouts>
</page>
</global>
</config>
/app/etc/modules/custom_layouts.xml:
<?xml version="1.0"?>
<config>
<modules>
<custom_layouts>
<codePool>local</codePool>
<active>true</active>
</custom_layouts>
</modules>
</config>
/app/design/frontend/THEME/default/template/page/home-layout.phtml:
CODE...
Any idea why this might not be properly appearing? I've double checked to see if the theme is correctly set in Magento too, but that didn't affect anything (obviously).
Thank you for any help in advance!
Alex
Your code looks fine, it seems there may be caching issue, refresh your store cache.
admin->Cache Management->Select All->Select refresh option in action drop-down and press submit.
Hope this will resolve your problem.

Package’s local.xml not loading when a custom theme with local.xml is active

I have a design package from ThemeForest installed, which has been working just fine, but I am trying to create a new custom theme that consists of a custom.css stylesheet, and a local.xml layout file which only adds a reference to custom.css.
In Magento Admin, the value of System > Configuration > General > Design / Package / Current Package Name is set to the design package I installed. That works fine until I set Design / Themes / Default to my new custom theme, which causes the local.xml file of the design package to be ignored. I can verify this by removing the local.xml of my custom theme or by replacing it with the one from the design package.
The same thing happens when I set Design / Themes / Layout to another theme, now the local.xml file from the package, and the one from Design / Themes / Default are ignored. I could work around this problem by combining the contents of all the local.xml files into a single one under Design / Themes / Layout, but that’s obviously not a desirable solution.
I have made custom themes before but this is the first time I have had this problem, does anyone have a solution?
Problem
You have run into a limitation of Magento’s design fall back hierarchy. The way it works is to search backwards from most specific location, to least specific.
... if your custom theme calls for a CSS file called ‘styles.css’ but the Magento application is unable to find the file in your custom theme, Magento will go to the next theme in the hierarchy to find the file ... it will continue working down the hierarchy of themes until it’s able to locate the file called ‘styles.css.’
This method of building design is called fall backs, because the application ‘falls back’ to the next possible source of required files in order to retrieve and load a requested file.
What this means for you is that the layout file local.xml can only be sourced from one location, and it will be whatever is the most specific to the current theme. So Magento will search for it in the following priority:
app/design/frontend/$package/$theme/layout/local.xml
app/design/frontend/$package/default/layout/local.xml
app/design/frontend/base/default/layout/local.xml
The important thing to realize is that each of these files overrides the next one down, rather than adding to them. I have heard that Magento 2.x may address this situation, but for 1.x we need to work around this.
A Possible Solution
The way I would go about solving this is to create a simple extension that just loads your custom css file in a separate layout file. Then you do not need the local.xml file in your new theme and it will continue to fall back to default.
app/etc/modules/My_Theme.xml:
<?xml version="1.0"?>
<config>
<modules>
<My_Theme>
<active>true</active>
<codePool>local</codePool>
</My_Theme>
</modules>
</config>
app/code/local/My/Theme/etc/config.xml:
<?xml version="1.0"?>
<config>
<modules>
<My_Theme>
<version>0.1.0</version>
</My_Theme>
</modules>
<frontend>
<layout>
<updates>
<my_theme>
<file>my_theme.xml</file>
</my_theme>
</updates>
</layout>
</frontend>
</config>
app/design/frontend/$package/$theme/layout/my_theme.xml:
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="head">
<action method="addCss"><stylesheet>css/my_theme.css</stylesheet></action>
</reference>
</default>
</layout>
This uses Magento’s design fall back method to load the file as well. So you could put this at skin/frontend/$package/$theme/css/my_theme.css or in the $package/default/css/ subdirectory.

Disable a Module in Certain magento Theme

Is it possible to disable certain modules when running a certain theme? I'm working on a mobile friendly version of our Magento store and I've run into some issues with a few extensions. Rather than customize them, the default iphone theme is sufficient, so I'd like to just disable those modules so it runs the default code when on a mobile device. Is this possible?
You can disable that module in local.xml. Just paste this xml in your theme's local.xml.
<config>
<modules>
<[Your_Module_Name]>
<active>false</active>
</[Your_Module_Name]>
</modules>
</config>
In admin panel
system -> configuration -> advanced
here you can disable certain module

Add a magento layout

How to add a layout on magento system? I want to add a new layout which can be selected from administration panel as well.
I am trying to make two layout on the website. One layout with banner and another without banner. Lets say I want
2Columns-right.phtml and 2Column-right-wBanner.phtml
How to add this?
For This you Need to create a custom module.
In Module etc/config.xml copy following code:
<?xml version="1.0"?>
<config>
<global>
<page>
<layouts>
<custom_layout_wbanner>
<label>Custom Layout Banner</label>
<template>page/2Column-right-wBanner.phtml</template>
</custom_layout_wbanner>
</layouts>
</page>
</global>
</config>
Hope This Help !!

How to activate new adminhtml theme in Magento?

I developed a new module under Magento, it works well. I designed a new adminhtml theme, however I don't find from where to activate it. I browsed all the backend and found only [design change] which change the store theme..
Is there a way to tell Magento to use my theme?
Within config.xml under etc folder of your module, add the following
<stores>
<admin>
<design>
<package>
<name>NameSpace</name>
</package>
<theme>
<default>theme</default>
</theme>
</design>
</admin>
</stores>
Assuming you created your theme under app/design/adminhtml/NameSpace/theme

Resources