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

Page 2 of 2
layout xml default not working. any ideas? 
 
lazzymonk
Guru
 
Avatar
Total Posts:  391
Joined:  2008-04-03
England
 

ive been trying for hours to figure this out. and i dont think we will without help from the magento staff

 
Magento Community Magento Community
Magento Community
Magento Community
 
hogehoge
Jr. Member
 
Total Posts:  10
Joined:  2008-05-06
 

Hi.

I have the same problem.

However, it doesn’t solve it.
I want also to learn the solution.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Unirgy
Guru
 
Avatar
Total Posts:  478
Joined:  2007-09-07
 

@lazzymonk: is this module going to be for community or commercial?

if for community, why won’t you post a zip with the module files and possibly with common effort we will resolve it smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
lazzymonk
Guru
 
Avatar
Total Posts:  391
Joined:  2008-04-03
England
 

its for the community but there is no point in posting the file as the problem is not specific to my code. if you create a module that is not called mage/whatever and try to use default xml it wont work.

the problem is with magento not the code.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Unirgy
Guru
 
Avatar
Total Posts:  478
Joined:  2007-09-07
 

dude, it works for me, i’ve tried it, i swear.

maybe it’s a small thingie, you know, that you can’t see after hours of working on it, need a fresh look?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Michael_1
Enthusiast
 
Total Posts:  826
Joined:  2007-08-31
 

Can you please try the following instead of your default section:

<default>
    <
reference name="right">
        <
block type="core/template" name="test1.callout" template="callouts/right_col.phtml"/>
        <
block type="core/template" name="test2.callout" template="callouts/right_col.phtml"/>
        <
block type="core/template" name="test3.callout" template="callouts/right_col.phtml"/>
    </
reference>
</default>

It should show 3 additional callouts in right (or maybe it’s left) column.

I also see a problem in your code - you have 2 blocks with the same global name “blog” (that should be unique in currently loaded and processes layout of current page) - so your code might work on all the pages except the blog/index/index and blog/post/view pages as on those two you are trying to create 2 “blog” blocks - one in right column and the other in content area. I didn’t check in the core code but either second block will override the first or it will be silently discarded.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lazzymonk
Guru
 
Avatar
Total Posts:  391
Joined:  2008-04-03
England
 

Nothing happend :(

i even tried the follow to see if that would work.

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
        <
reference name="right">
            <
block type="core/template" name="test1.callout" template="callouts/right_col.phtml"/>
            <
block type="core/template" name="test2.callout" template="callouts/right_col.phtml"/>
            <
block type="core/template" name="test3.callout" template="callouts/right_col.phtml"/>
        </
reference>
    </default>
</
layout>

That had the same result, nothing.

bellow is my config.xml

<?xml version="1.0"?>
<config>
    <
modules>
        <
Lazzymonk_Blog>
            <
version>0.1.0</version>
        </
Lazzymonk_Blog>
    </
modules>
    <
frontend>
        <
routers>
            <
blog>
                <use>
standard</use>
                <
args>
                    <
module>Lazzymonk_Blog</module>
                    <
frontName>blog</frontName>
                </
args>
            </
blog>
        </
routers>
        <
layout>
            <
updates>
                <
blog>
                    <
file>blog.xml</file>
                </
blog>
            </
updates>
        </
layout>
    </
frontend>
    <
admin>
        <
routers>
            <
blog>
                <use>
admin</use>
                <
args>
                    <
module>Lazzymonk_Blog</module>
                    <
frontName>blog</frontName>
                </
args>
            </
blog>
        </
routers>
    </
admin>
    <
adminhtml>
        <
menu>
            <
blog module="blog">
                <
title>Blog</title>
                <
sort_order>71</sort_order>               
                <
children>
                    <
items module="blog">
                        <
title>Manage Posts</title>
                        <
sort_order>0</sort_order>
                        <
action>blog/manage_blog</action>
                    </
items>
                    <
comment module="blog">
                        <
title>Manage Comments</title>
                        <
sort_order>1</sort_order>
                        <
action>blog/manage_comment</action>
                    </
comment>
                </
children>
            </
blog>
        </
menu>
        <
acl>
            <
resources>
                <
all>
                    <
title>Allow Everything</title>
                </
all>
                <
admin>
                    <
children>
                        <
Lazzymonk_Blog>
                            <
title>Blog Module</title>
                            <
sort_order>10</sort_order>
                        </
Lazzymonk_Blog>
                        <
system>
                            <
children>
                                <
config>
                                    <
children>
                                        <
blog>
                                            <
title>Blog Section</title>
                                        </
blog>
                                    </
children>
                                </
config>
                            </
children>
                        </
system>
                    </
children>
                </
admin>
            </
resources>
        </
acl>
        <
layout>
            <
updates>
                <
blog>
                    <
file>blog.xml</file>
                </
blog>
            </
updates>
        </
layout>
    </
adminhtml>   
    <global>
        <
models>
            <
blog>
                <class>
Lazzymonk_Blog_Model</class>
                <
resourceModel>blog_mysql4</resourceModel>
            </
blog>
            <
blog_mysql4>
                <class>
Lazzymonk_Blog_Model_Mysql4</class>
                <
entities>
                    <
blog>
                        <
table>blog</table>
                    </
blog>
                    <
post>
                        <
table>blog</table>
                    </
post>
                    <
comment>
                        <
table>blog_comment</table>
                    </
comment>
                </
entities>
            </
blog_mysql4>
        </
models>
        <
resources>
            <
blog_setup>
                <
setup>
                    <
module>Lazzymonk_Blog</module>
                </
setup>
                <
connection>
                    <use>
core_setup</use>
                </
connection>
            </
blog_setup>
            <
blog_write>
                <
connection>
                    <use>
core_write</use>
                </
connection>
            </
blog_write>
            <
blog_read>
                <
connection>
                    <use>
core_read</use>
                </
connection>
            </
blog_read>
        </
resources>
        <
blocks>
            <
blog>
                <class>
Lazzymonk_Blog_Block</class>
            </
blog>
        </
blocks>
        <
helpers>
            <
blog>
                <class>
Lazzymonk_Blog_Helper</class>
            </
blog>
        </
helpers>
        <
events>
            <
controller_front_init_routers>
                <
observers>
                    <
blog>
                        <
type>singleton</type>
                        <class>
Lazzymonk_Blog_Controller_Router</class>
                        <
method>initControllerRouters</method>
                    </
blog>
                </
observers>
            </
controller_front_init_routers>
        </
events>
    </global>
    
    <default>
        <
blog>
            <
blog>
                <
enabled>1</enabled>
                <
title>Blog</title>
                <
footerEnabled>1</footerEnabled>
                <
menuRight>1</menuRight>
                <
topEnabled>1</topEnabled>
                <
blogcrumbs>1</blogcrumbs>
                <
recent>5</recent>
                <
layout>page/2columns-right.phtml</layout>
            </
blog>
        </
blog>
    </default>
</
config>
 
Magento Community Magento Community
Magento Community
Magento Community
 
lazzymonk
Guru
 
Avatar
Total Posts:  391
Joined:  2008-04-03
England
 

well that’s bizarre. i rename my module from Lazzymonk/Blog to Monk/Blog and now it works.

Maybe there is a length limit on the name or maybe magento just doesnt like me.

 
Magento Community Magento Community
Magento Community
Magento Community
 
hogehoge
Jr. Member
 
Total Posts:  10
Joined:  2008-05-06
 

I think that it is not a length limit.
Because the namespace of my module is 4 characters, but it doesn’t work.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 2