Magento Forum

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

im having a problem with the layout xml for a module im writing.

the default section of it doesnt seem to be triggered.

nothing i put in it seems to work. if i purposely code an error into it, nothing happens.
if i put an error anywhere else in the same file the error is shown in the store.
the rest of the xml in the file works fine, just nothing in the default section.

is there something i have missed to trigger the default? ive made a few modules now without a problem.

Help

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

I guess that would be easier to help if you post here that xml.

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

<?xml version="1.0"?>

<layout version="0.1.0">
    <default>
        <
reference name="right">
            <
block type="blog/blog" name="blog" template="blog/menu.phtml"/>
        </
reference>
    </default>

    <
blog_index_index>
        <
reference name="content">
            <
block type="blog/blog" name="blog" template="blog/blog.phtml"/>
        </
reference>
        <
reference name="right">
            <
block type="blog/blog" name="left.blog.menu" template="blog/menu.phtml" />
        </
reference>
    </
blog_index_index>
    <
blog_post_view>
        <
reference name="content">
            <
block type="blog/post" name="post" template="blog/post.phtml" />
        </
reference>
        <
reference name="right">
            <
block type="blog/blog" name="left.blog.menu" template="blog/menu.phtml" />
        </
reference>
    </
blog_post_view>
</
layout>

 
Magento Community Magento Community
Magento Community
Magento Community
 
johnnydaboy
Jr. Member
 
Total Posts:  2
Joined:  2008-07-19
 

I would guess that you need to disable caching. In the admin interface, go to System > Cache Management, then select “Disable” from All Cache and click save. That is what it says in the documentation.

I myself am had the same problem, but am not able to disable the cache. I’ve posted elsewhere on this issue but not gotten a response yet.

>>I’m a designer trying to make changes to templates but the changes are not showing up.
>>I followed the instructions to disable caching, but I think something is wrong—when I select “disable” (or any other item for that matter) and click save, I get sent to the root of my site, totally dropped out of the administrative interface.
>>I found another topic on caching that suggested I could delete var/cache but that hasn’t helped.

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

ive tried disabling the cache, even deleting the cache files. all of the xml works except the bit in the default tags. ive never had this problem before.

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

@lazzymonk:

nothing i put in it seems to work. if i purposely code an error into it, nothing happens.
if i put an error anywhere else in the same file the error is shown in the store.

sorry, i didn’t get it - if you put deliberate XML error inside <default> tag it doesn’t show an XML parse error on your blog pages?

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

thats right. no errors nothing. but i put a deliberate xml error anywhere else, i get a parse error. the rest of the xml does exactly as it is suppose to as well. This is driving me crazy.

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

Any ideas anyone?

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

if anyone is interested this is what im working on.

http://lazzymonk.co.uk/blog/

its a blog for magento. no wordpress or other complicated integration this time. its all magneto so will install easily.

But i dont want to release this to the community until i can solve this xml problem.

HELP

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

can you disable cache, introduce XML syntax error into the file inside <default>, and post when it’s done with paste of xml file, so i can take a look at the pages?

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

Is the second instance of name="blog" messing it up perhaps?

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

@sherrie: you’re genius - i’ve totally missed it - as both <default> and <blog_index_index> are called, the 2nd (in content) will override the 1st

but this still doesn’t answer how it’s possible to xml parse error is being ignored inside <default> ...

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

I have solved the problem. the xml was not at fault. it was the name of my module.

i had it running from local/Lazzymonk/Blog

i changed it (and renamed everything to match) to local/Mage/Blog and it worked fine.

any idea why this is the case? i would like it to be lazzymonk, but if it has to be mage to work then fine

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

@lazzymonk: most probably you have forgotten declaration of models, blocks or helpers in etc/config.xml

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

models, helpers and blocks are declared in config.xml, so it isnt that.

Is there something special that needs declaring to tell magento to load the default section?

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

@lazzymonk: can you attach your etc/config.xml ?

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