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

Header and Footer template files
 
aquiss
Member
 
Total Posts:  54
Joined:  2008-05-03
United Kingdom
 

I wonder if the community can help?

Like many, i suspect, we want to use our own designs, and many, will I am sure have pre-made or inhouse developed designs which will be in the form of html/php and images files exported from PSD and the likes.

What we can’t find is the exact files that allow us to to change the header and footer actual designs (ie: drop in the html, save and refresh). I did find files called header.phtml and footer.phtml located in app/design/frontend/default/default/template/page/html but these just seem to be the actual some of textual content / elements that drop in on the pages.

I have used the search option, but can’t find any related references to the exact files, and personally got lost quite a few times in the directory file structure to locate these.

 
Magento Community Magento Community
Magento Community
Magento Community
 
cibernoid
Sr. Member
 
Avatar
Total Posts:  208
Joined:  2008-02-12
 

http://www.magentocommerce.com/design_guide/

 
Magento Community Magento Community
Magento Community
Magento Community
 
aquiss
Member
 
Total Posts:  54
Joined:  2008-05-03
United Kingdom
 

cibernoid,

Thanks for your reply, however we have already viewed those pages in quite some detail (infact 3 of us have), and whilst we all agree that they are really well written, they do actually fail to list the exact key files which can be edited without causing problems to the core software.

 
Magento Community Magento Community
Magento Community
Magento Community
 
hmmLetMeSee
Jr. Member
 
Total Posts:  1
Joined:  2008-05-08
 

Try this:
http://video.google.com/videoplay?docid=-4067344684924672049&hl;=en

This has got to be one the most frustrating fu_k_ng things I have come across next to climbing mount everest with dental floss.
Ever heard of the KISS rule?

 
Magento Community Magento Community
Magento Community
Magento Community
 
l0st
Member
 
Total Posts:  55
Joined:  2008-04-06
 

well, did you refresh the cache? system > cache management

There is a drop down menu. make sure you use it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 

I used my own design, and has started to design a new one; except in the early stage, now I don’t have problem moving things around as far as template concerns. Perhaps you can show us exactly the steps you have taken, and what files you have modified.

You post is quite vague as to what you wanted to do.

By the way, are you aware of the Template Path Hints feature? Do a search on how to turn it on if you don’t already know.

 
Magento Community Magento Community
Magento Community
Magento Community
 
aquiss
Member
 
Total Posts:  54
Joined:  2008-05-03
United Kingdom
 

chinesedream,

Thanks for your valued input. I was not aware of the Hints feature, but can see that being quite useful.

Looking at it’s output, it’s not revealing anything we have not looked at already, therefore I presume the files we were attempting to edit are correct (ie: http://www.magentocommerce.com/design_guide/articles/magento-design-terminologies4 -> Block Diagram 1 -> Header and Footer )

I presume these relate to (?):

frontend/default/default/template/page/html/header.phtml
frontend/default/default/template/page/html/footer.phtml

 
Magento Community Magento Community
Magento Community
Magento Community
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 

That’s not just it.

Layout (located in app/design/frontend/your_interface/your_theme/layout/)
These are basic XML files that define block structure for different pages as well as control META information and page encoding.For in-depth look into layoutsread Intro to Layouts)
Templates (located in app/design/frontend/your_interface/your_theme/template/)
These are PHTML files that contain (X)HTML markups and any necessary PHP tags to create logic for visual presentation.

By using your own design, I reckon you meant you are making your unique template design, not just skin correct?  when I think of template design, I think of my own design, with the power and freedom to display blocks/elements any where I wanted them be, for example, placing callouts in the bottom (not necessarily to be in the ‘footer’) and placing footer on the top (not necessarily needed to be inside the ‘header’) - the structural blocks that Magento pre-defind it; if I like, I can even have multi-row, multi-columns layouts and have the category menu sits on the left column vertically instead of the default horizontal. In order to do this, I need also to modify/re-arrange the order of the blocks or create new blocks in the Layout, Templates, along with Skins.

So to move the footer to the top, you need also to modify the page.xml and all the templates located in the page - if you use only one template, say, 2columns-right.phtml, then you need only to move this ‘ <?php echo $this->getChildHtml('footer') ?>’ to the top, be it in the ‘header’ or not. If you decide to have the footer be in the header block, then the code in the page.xml should look something like this :

<block type="page/html_header" name="header" as="header">              
         <
block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">  
 <
block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml"/>
                                </
block>
      <
block type="core/text_list" name="top.menu" as="topMenu"/>
                    </
block>

because I am having the footer blocks sit inside the header, so I remove the

<div id="footer">
   
<?php echo $this->getChildHtml('footer'?>     
 
</div>
from all templates in the page, and place it in the html/header.phtml, so now my header.phtml looks something like this.

<div id="footer">
   
<?php echo $this->getChildHtml('footer'?>     
 
</div>
<
div id="header_search">  <?=$this->getChildHtml('topSearch')?></div>
         <
div class="clear">&nbsp;</div>  
           <
div id="menu">
          <
ul id="nav"><?=$this->getChildHtml('topMenu')?>
          
</ul>
          </
div><!--end menu-->

If you make the changes and placed them in the right places, your site should reflect the changes correctly without refreshing, clearing the caches; if it doesn’t show and no errors, then pay a visit to Caches Management just in case.

 
Magento Community Magento Community
Magento Community
Magento Community
 
aquiss
Member
 
Total Posts:  54
Joined:  2008-05-03
United Kingdom
 

chinesedream,

Many thanks for that detailed, and really useful, reply. A few of things you have just said have just clicked into place....we have had some Euerka moments rasberry

I think you are pretty much understand where we coming from, and you appear to be designing in a similar fashion to us, or what we consider normal expectations of design (ie: building with blocks etc).

For us, the hurdle was/is to get over the terms that Magento have used, the actual files containing those key elements, and what we can/can’t do in each (the bit you listed above has actually resolve this bit quite a bit for us).

PS: In the video link provided by “hmmLetMeSee” above, there was an indevelopment feature that highlighted on the page what was being called in red boxes. Does anyone know if Magento ever included that feature?

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