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

No titles at all
 
NewFolder
Jr. Member
 
Total Posts:  13
Joined:  2008-11-14
 

Hello all!

I have created some pages via CMS->Manage Pages. I’ve set them custom root and custom layouts. Everything works fine but the titles on all pages are default.

This is what I did:

Layout Update XML in CMS->Manage Pages->Add new:

<reference name="root">
    <
action method="setTemplate"><template>trainwreck/about_us.phtml</template></action>
</
reference>

This is what I have in about_us.phtml file

<?php
$layout 
Mage::getSingleton('core/layout');
?>
<?
=$layout->getBlock('page_header')->toHtml()?>
<div id="body">
        
<?php
            $block 
$layout->getBlock('tw_header');            
            print 
$block->toHtml();
        
?>
        
<div id="content">
            <
div id="main_content">
                <
h2>About us text!!!</h2>
            </
div>
            
<?php
                $block 
$layout->getBlock('tw_form');
                print 
$block->toHtml();
            
?>
        
</div>
        
<?php
            $block 
$layout->getBlock('tw_footer');
            print 
$block->toHtml();
        
?>
    
</div>
<?=$layout->getBlock('page_footer')->toHtml()?>

My page_header block has the following code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>">
<
head>
<?php
echo $this->getChildHtml('tw_custom_head');
?>
</head>
<
body>

My custom layout is:

<?xml version="1.0"?>
<layout version="0.1.0">

<default>    
    <
block type="core/template" name="page_header" as="page_header" template="trainwreck/parts/page-header.phtml">
        <
block type="page/html_head" name="tw_custom_head" as="tw_custom_head">
                <
action method="addJs"><script>prototype/prototype.js</script></action>
                <
action method="addJs" ifconfig="dev/js/deprecation"><script>prototype/deprecation.js</script></action>
                <
action method="addJs"><script>prototype/validation.js</script></action>
                <
action method="addJs"><script>scriptaculous/builder.js</script></action>
                <
action method="addJs"><script>scriptaculous/effects.js</script></action>
                <
action method="addJs"><script>scriptaculous/dragdrop.js</script></action>
                <
action method="addJs"><script>scriptaculous/controls.js</script></action>
                <
action method="addJs"><script>scriptaculous/slider.js</script></action>
                <
action method="addJs"><script>varien/js.js</script></action>
                <
action method="addJs"><script>varien/form.js</script></action>
                <
action method="addJs"><script>varien/menu.js</script></action>
                <
action method="addJs"><script>mage/translate.js</script></action>
                <
action method="addJs"><script>mage/cookies.js</script></action>               
                
                <
action method="addCss"><stylesheet>trainwreck/style.css</stylesheet></action>
                <
action method="addItem"><type>skin_css</type><name>trainwreck/ie6.css</name><params/><if>IE 6</if></action>
        </
block>
    </
block>
    
    <
block type="core/template" name="tw_header" as="tw_header" template="trainwreck/parts/header.phtml" />
    <
block type="core/template" name="tw_footer" as="tw_footer" template="trainwreck/parts/footer.phtml" />
    <
block type="core/template" name="tw_form" as="tw_form" template="trainwreck/parts/form.phtml" />
    <
block type="core/template" name="page_footer" as="page_footer" template="trainwreck/parts/page-footer.phtml" />
</default>

</
layout>

Please help! Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Benxamin
Jr. Member
 
Avatar
Total Posts:  15
Joined:  2009-10-06
Sioux Falls, SD
 

Please post your “tw_custom_head.phtml” file.

What is the directory path that tw_custom_head.phtml is in?

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