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

Design Guide - Intro To Layouts - Exercize #2 ---> Error: Undefined variable ---> Documentation Bug? 
 
kalqlate
Jr. Member
 
Total Posts:  26
Joined:  2008-06-17
 

After a fresh install and several tests of version 1.0.19870.4 I decided to experiment with modifying layouts. I followed the design guide, performed excersize #1 on the “Intro To Layouts” page (link below) which worked fine, and proceeded to excersize #2

http://www.magentocommerce.com/design_guide/articles/intro-to-layouts/

Excersize #2 produced the following error:

Undefined variable: toplinks in (domain)/app/design/frontend/default/default/template/page/html/top.links.phtml on line 21

I thought I made a typo along the way so I backed out my changes to the 3 files changed (page.xml, catalogsearch.xml, header.xml) by copying the originals of these files to their appropriate folders and retested to ensure that demo pages once again loaded without error.

I’ve now gone through 3 iterations of refreshing the files, following the excersize TO THE LETTER, and each time the above error is reported.

Before posting this problem I searched Magento forums and the web for anything related to problems with this excersize and found nothing in regards to version 1.0.19870.4. However, I did find a post where it was indicated thta the excersize was going to updated to reflect changes in a prior version.

Is this excersize still broken? If not, any ideas of what I’m missing? Again, I followed the excersize TO THE LETTER… 3 TIMES!

Thanks, in advance.

 
Magento Community Magento Community
Magento Community
Magento Community
 
kalqlate
Jr. Member
 
Total Posts:  26
Joined:  2008-06-17
 

Ok, finally got back around to figuring this out.

Looks like a possible documentation bug. Big frustrations results when you assume that documentation on early releases of a quickly evolving system is 100% correct!

The instructions for step 3 of Excersize 2 states:

Now that you’ve located the area of the individual SEO link items, you will now begin the steps to isolate ‘Advanced Search’ from the bunch and make it it’s own thing in the header. First go back to page.xml and create a new block <block type="page/template_links" name="header_links" as="header_links" template="page/html/top.links.phtml”/> and nest it inside <block name="header">. You’ve made the layout updates to expect this link in header.phtml. Open template/page/html/header.phtml, and type in <?=$this->getChildHtml('header_links')?> where you want the link to reside.

The block statement:

<block type="page/template_links" name="header_links" as="header_links" template="page/html/top.links.phtml"/>

allows the page and the link to show when you drop the template= section as follows:

<block type="page/template_links" name="header_links" as="header_links"/>

Even though that change causes the page and the link to show properly I can’t be certain if the instructions were intended to be written without the template= section or if the specified template was the incorrect one.

Before I report this as a documentation bug, I would appreciate it if someone else can test and confirm that the excersize, as currently written, produces the error. If there is a Magento template expert who can just examine the excersize #2 text at the link given in my prior post and confirm “Oh yeah, that’ll cause a problem alright”, that will suffice as well.

Cheers!

 
Magento Community Magento Community
Magento Community
Magento Community
 
kalqlate
Jr. Member
 
Total Posts:  26
Joined:  2008-06-17
 

Thank you, and you’re quite welcome, Ohminu.

And, please… do more screencasts… lovin’ that voice of yours! Oh and, and, um, you’re very precise, thorough, quick, and informative as well. wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
abaki
Member
 
Avatar
Total Posts:  32
Joined:  2008-07-02
USA
 

and, also some more example…

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