Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Add new layouts (page/*.phtml files) and make them appear in admin CMS and Cateory dropdowns
 
Dan Orsborne
Member
 
Total Posts:  72
Joined:  2007-09-20
 

If you want to create a new template and get it to appear in the dropdowns first create the new phtml file in the app\design\frontend\OC\default\template\page folder. I’ll call it homepage.phtml for this example.  I would like this template to be used on the home cateogry so I need to open app\code\core\Mage\Cms\etc\config.xml and edit the following code:

<cms>
            <
layouts>
                <empty><
label>Empty</label><template>page/one-column.phtml</template></empty>
                <
one_column><label>1 column</label><template>page/1column.phtml</template></one_column>
                <
left_column><label>Column on the left</label><template>page/2columns-left.phtml</template></left_column>
                <
right_column><label>Column on the right</label><template>page/2columns-right.phtml</template></right_column>
                <
three_column><label>3 columns</label><template>page/3columns.phtml</template></three_column>
                <
homepage_column><label>Homepage</label><template>page/homepage.phtml</template></homepage_column>
            </
layouts>
        </
cms>

This will now appear in the admin area so I can use it for cateogies or CMS pages

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bernhard Huber
Jr. Member
 
Avatar
Total Posts:  28
Joined:  2007-10-03
Warsaw Poland
 

To my mind, it would be cool, if this could be autodetected, it would improve workflow

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

For this functionality you can customize following files:
* app/code/core/Mage/Catalog/Model/Entity/Category/Attribute/Source/Layout.php - to read files from specific directory
* app/code/core/Mage/Catalog/Block/Category/View.php - line 41 - use the attribute value instead of configuration

Let me know if you have questions smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
StevePeters
Jr. Member
 
Total Posts:  5
Joined:  2009-11-18
 
Dan Orsborne - 09 October 2007 01:12 AM

If you want to create a new template and get it to appear in the dropdowns first create the new phtml file in the app\design\frontend\OC\default\template\page folder. I’ll call it homepage.phtml for this example.  I would like this template to be used on the home cateogry so I need to open app\code\core\Mage\Cms\etc\config.xml and edit the following code:

<cms>
            <
layouts>
                <empty><
label>Empty</label><template>page/one-column.phtml</template></empty>
                <
one_column><label>1 column</label><template>page/1column.phtml</template></one_column>
                <
left_column><label>Column on the left</label><template>page/2columns-left.phtml</template></left_column>
                <
right_column><label>Column on the right</label><template>page/2columns-right.phtml</template></right_column>
                <
three_column><label>3 columns</label><template>page/3columns.phtml</template></three_column>
                <
homepage_column><label>Homepage</label><template>page/homepage.phtml</template></homepage_column>
            </
layouts>
        </
cms>

This will now appear in the admin area so I can use it for cateogies or CMS pages

The code noted above does not appear in config.xml in Magento ver. 1.3.2.4.

 
Magento Community Magento Community
Magento Community
Magento Community
 
StevePeters
Jr. Member
 
Total Posts:  5
Joined:  2009-11-18
 
Moshe - 24 October 2007 12:01 AM

For this functionality you can customize following files:
* app/code/core/Mage/Catalog/Model/Entity/Category/Attribute/Source/Layout.php - to read files from specific directory
* app/code/core/Mage/Catalog/Block/Category/View.php - line 41 - use the attribute value instead of configuration

Let me know if you have questions smile

Line 41 of app/code/core/Mage/Catalog/Block/Category/View.php is blank.

Looks like this thread is referring to an earlier Magento version and is useless for Magento ver. 1.3.2.4

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top