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

Handler for pages distinct than home
 
Electric-dsctc
Member
 
Avatar
Total Posts:  35
Joined:  2008-01-21
 

Hello people...I have this question; what handler I should use for showing a block on every page but the home page ?  Specifically, I want to put a <home> link somewhere when I’m not there, on the top.left.links
Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Electric-dsctc
Member
 
Avatar
Total Posts:  35
Joined:  2008-01-21
 

Maybe I wasn’t clear of what I’m asking…
On catalog.xml there are handlers such as <catalog_category_default> , <catalog_category_layered> , <catalog_product_view> etc....
What I’m looking for is the handler I should use for displaying something on all pages but the home page.
Is this done by handlers or should I do it old style on my template page? smile
Thanks again !

 
Magento Community Magento Community
Magento Community
Magento Community
 
Serge at Varien
Magento Team
 
Avatar
Total Posts:  73
Joined:  2008-01-18
 

the best way for you is to go to /app/design/frontend/default/default/layout/page.xml (or to according xml in your theme), find the next line there:

<block type="core/text_list" name="left" as="left"/>

and replace it with something like:

<block type="core/text_list" name="left" as="left">
    <
block type="core/text" name="test.text">
        <
action method="setText">
            <
text><![CDATA[<span style="color:red; font-size: 18px; font-weight: bold;">TEST LAYOUT UPDATE</span>]]></text>
        </
action>
    </
block>
</
block>

or better way:

<block type="core/text_list" name="left" as="left">
    <
block type="core/template" name="test.text" template="path/to/template.phtml"/>
</
block>

but don’t forget to create template itself in the second case smile

that will show your new block on ALL pages and now a bit tricky part to hide it on the Home page:

go to the Admin area -> CMS -> Manage Pages -> select Home page in the grid -> General Information -> Layout Update XML text area -> add next piece of XML there:

<reference name="right">
   <
action method="unsetChild"><name>test.text</name></action>
</
reference>

it should help you.

Best regards,
Serge

 
Magento Community Magento Community
Magento Community
Magento Community
 
Electric-dsctc
Member
 
Avatar
Total Posts:  35
Joined:  2008-01-21
 

Thanks Serge…
Actually...I realized that I didn’t know how add a link on the top nav links rasberry
How can I do that?
I checked out the ..../template/page/html/top.links.phtml file , that reads an array that comes from app/code/core/Mage/Page/block/html/toplinks.php but there I get kind of lost....
I could manually put the link somewhere somehow but it will brake my layout....I need to add it on the toplinks array.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Serge at Varien
Magento Team
 
Avatar
Total Posts:  73
Joined:  2008-01-18
 

please, check this thread for the more info about:
http://www.magentocommerce.com/boards/viewthread/1212/

actually you need something similar to this:

<reference name="top.links">
    <
action method="addLink"><li/><a>href="{{baseUrl}}your/link/here"</a><label>Your Link Text</label></action>
</
reference>

or just call action in the page.xml extending one of top nav blocks (top.left.links or top.right.links).

Best regards,
Serge

 
Magento Community Magento Community
Magento Community
Magento Community
 
Electric-dsctc
Member
 
Avatar
Total Posts:  35
Joined:  2008-01-21
 

Serge , thanks a lot for your support, but I can’t seem to make it right..
I try following what’s on the post you linked but ended up with a lot of errors…

or just call action in the page.xml extending one of top nav blocks (top.left.links or top.right.links).

I don’t understand what you mean by extending....I don’t have a <reference> tag on page.xml for the links…

 
Magento Community Magento Community
Magento Community
Magento Community
 
Serge at Varien
Magento Team
 
Avatar
Total Posts:  73
Joined:  2008-01-18
 

ok, I got you. you really have no references in page.xml.
my example is for “Layout Update XML” we have in the admin (as shown in my example above).

if you want to make alterations directly in the page.xml than just replace the next lines:

<block type="page/html_toplinks" name="top.left.links" as="topLeftLinks"/>
<
block type="page/html_toplinks" name="top.right.links" as="topRightLinks"/>
with something like this:
<block type="page/html_toplinks" name="top.left.links" as="topLeftLinks">
    <
action method="addLink"><li/><a>href="{{baseUrl}}your/link/here"</a><label>Your Link Text</label></action>
</
block>
<
block type="page/html_toplinks" name="top.right.links" as="topRightLinks">
    <
action method="addLink"><li/><a>href="{{baseUrl}}your/link2/here"</a><label>Your Link2 Text</label></action>
</
block>
 
Magento Community Magento Community
Magento Community
Magento Community
 
Electric-dsctc
Member
 
Avatar
Total Posts:  35
Joined:  2008-01-21
 

Thanks man! ... works OK...and more important.... I understood the <action> thing inside the block....
Still don’t know how to merge the two toplinks..but that’s on another post smile
again, thanks for the support

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