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

template.phtml not shown
 
somebody
Jr. Member
 
Total Posts:  18
Joined:  2008-05-14
Leipzig, Germany
 

hi everyone,

since my last post at which i asked for some documentation of the moule-xml’s i did some experimentations by my own and got a module which is shown in the backend and also the block-class is running and also the block of the layoutfile is generated but the templatefile does not appear or it doesn’t cause an output.

and i don’t know why??!!

here my stupid code

app/etc/modules/B81_Fullnavigation.xml:

<?xml version="1.0"?>
<config>
    <
modules>
        <
B81_Fullnavigation>
            <
active>true</active>
            <
codePool>local</codePool>
        </
B81_Fullnavigation>
    </
modules>
</
config>

app/code/local/B81/Fullnavigation/etc/config.xml:

<?xml version="1.0"?>
<config>
    <
modules>
        <
B81_Fullnavigation>
             <
version>1.0.0</version>       
        </
B81_Fullnavigation>
    </
modules>
    <global>
        <
blocks>
            <
fullnavigation>
                <class>
B81_Fullnavigation_Block</class>
            </
fullnavigation>
        </
blocks>
    </global>
    <
frontend>
        <
layout>
            <
updates>
                <
fullnavigation>
                    <
file>fullnavigation.xml</file>
                </
fullnavigation>
            </
updates>
        </
layout>
    </
frontend>
</
config>

app/design/Interface/theme/template/fullnavigation/navigation.phtml:

<div>blabla</div>

app/design/Interface/theme/layout/fullnavigation.xml

<layout version="0.1.0">
     <default>
         <
reference name="teaser.select">
            <
block type="fullnavigation/nav" name="fn" template="fullnavigation/navigation.phtml"/>
        </
reference>
     </default>
</
layout>

can anyone give me a hint please??

thanks alot and many hugs
sebastian

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

it is hard to know what’s wrong without more information:

1. what is the declaration of “teaser.select” block?
2. the paths are probably app/design/frontend/interface/theme/template/ ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
somebody
Jr. Member
 
Total Posts:  18
Joined:  2008-05-14
Leipzig, Germany
 

thank you for your answere.

to 1. teaser.select is a declaration out of the page.xml ‘(it works fine)
to 2. soory i forgot ... but not in the files

my it be an error of the blog-class, but if i enter a die(’somethin’); in it, it dies .... so its called correctly??
at this moment the block-class is just a copy of the category/block/navigation.php.

i don’t know whats wrong!

hugs
sebastian

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

teaser.select is not in original page.xml, please paste it’s declaration, or at least what type it is

 
Magento Community Magento Community
Magento Community
Magento Community
 
somebody
Jr. Member
 
Total Posts:  18
Joined:  2008-05-14
Leipzig, Germany
 

oh sh** i don’t get an mail when someone answered? i bookmarket this thread twice, but nothing happends? from other threads i get messages?

hi moshe,

sorry that i forgot to tell something about the reference-block. its just a core/text_list like the left or right container. just another name.
when i take it as a reference for the top.nemu it works fine ... so i thought it were not necessary to post some information. sorry i’m just a magento-noob and i still have to learn what ist necessary wink

the other file i don’t postet is the app/code/local/B81/Fullnavigation/Block/Nav.php. at this time its just a copy of the normal catalog/block/navigation.php. and it’s called corectly i think ... like i said above: whe i insert a die() it dies…

...its only the template.phtml which seems to be not called!

thanks for your help!

hugs
sebastian

 
Magento Community Magento Community
Magento Community
Magento Community
 
somebody
Jr. Member
 
Total Posts:  18
Joined:  2008-05-14
Leipzig, Germany
 

hello to everyone,

after hours i believe that i’m stupid wink
all these hours i searched to far away! it figured out that my layoutfile is not working/called ... but i don’t get it in my mind why?
so, if i declare the block of my module directly in the page.xml it works. the template is called!

the curious thing is that the block-class also is called when i decare the block in my layout-file! but why not the template?

hugs
sebastian

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

In your module etc/config.xml add these:

<config>
...
    <
frontend>

        <
layout>
            <
updates>
                <
my_layouts>
                    <
file>my_layouts.xml</file>
                </
my_layouts>
            </
updates>
        </
layout>
 
Magento Community Magento Community
Magento Community
Magento Community
 
somebody
Jr. Member
 
Total Posts:  18
Joined:  2008-05-14
Leipzig, Germany
 

hi moshe,

thanks alot. but is it already in my config.xml
my layout.xml seems also to be called and its also call the block-class of my module(i entered a simple echo ‘loaded’; in the _constructor(); to approve this).

the blockname is “fn” and the reference for now is “tselections”

layout version="0.1.0">
    <default>
           <
reference name="tselections">
           <
block type="filternavigation/selections" name="fn" template="filternavigation/selections.phtml" />
        </
reference>
    </default>
</
layout>

and like the profiler shows, the block “fn” is set up (i attached a screenshot ofthe current profiler). it seems to be an curious order of loading my block!!?? the red line shows the block which is set up by my layoutfile!

thanks alot for your help

hugs
sebastian

Image Attachments
profile_sc.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
somebody
Jr. Member
 
Total Posts:  18
Joined:  2008-05-14
Leipzig, Germany
 

has anyone a hint for me..please??

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

sorry, I do not see attached screenshot

 
Magento Community Magento Community
Magento Community
Magento Community
 
somebody
Jr. Member
 
Total Posts:  18
Joined:  2008-05-14
Leipzig, Germany
 

hi moshe,
thats a bit confusing wink but like i wrote above i also get no mails out of this thread, so im not really surprised, that you could not see the screenshot wink

here is a link ... http://www.bork81.com/out/profile_sc.jpg

it seems to be wrong, that my block which is defined in my layout.xml is loaded before the root-block?

hugs
sebastian

 
Magento Community Magento Community
Magento Community
Magento Community
 
somebody
Jr. Member
 
Total Posts:  18
Joined:  2008-05-14
Leipzig, Germany
 

ok .... now i’m really surprised!

the only failure was the NAMESPACE! As i changed it from “B81” to “Mage” it was working correctly!

now, in order to learn more about magento, my question:
WHY THIS??? IS IT NECESSARY TO USE THE MAGE-NAMESPACE TO ACES THE DEFAULT-NODE IN THE LAYOUT.XML???

The old namespace was set up correctlybut i could not use the <default> node in my layout.xml!

thanks alot so far for your help

hugs
sebastian

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