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

Moving Information displayed in one template to another. 
 
Jeffrey2
Member
 
Total Posts:  38
Joined:  2009-02-09
 

I’m looking to move some information that’s displayed in the category toolbar and move it up next to the category header.
See pics for simple example and explanation.

The code I’m trying to move is in template/catalog/product/list/toolbar.phtml and I’m moving it into template/catalog/category/view.phtml.

Here’s the code I’m moving.

<?php if($this->getLastPageNum()>1): ?>
                <?php 
echo $this->__('Items %s to %s of %s total'$this->getFirstNum(), $this->getLastNum(), $this->getTotalNum()) ?>
            <?php 
else: ?>
                
<strong><?php echo $this->__('%s Item(s)'$this->getTotalNum()) ?></strong>
            
<?php endif; ?>

I’m moving it into this code right after the </h2> tag located at the bottom of template/catalog/category/view.phtml

<?php else: ?>
    
<div class="category-head">
    
<?php if($this->IsRssCatalogEnable() && $this->IsTopCategory()): ?>
        
<a href="<?php echo $this->getRssLink() ?>" class="link-feed right"><?php echo $this->__('Subscribe to RSS Feed'?></a>
    
<?php endif; ?>
    
<h2><?php echo $_helper->categoryAttribute($_category$this->htmlEscape($_category->getName()), 'name'?></h2>
    </
div>
    
<?php if($_imgHtml): ?>
        
<p><?php echo $_imgHtml?></p>
    
<?php endif; ?>
    <?php 
if($_description=$_category->getDescription()): ?>
        
<class="category-description"><?php echo $_helper->categoryAttribute($_category$_description'description'?></p>
    
<?php endif; ?>
    <?php 
echo $this->getProductListHtml() ?>
<?php 
endif; ?>

Just copying and pasting the code where I want it shows the default “Item(s)” text, I believe this is because the code isn’t finding the item value’s it needs, such as getFirstNum() or getLastPageNum(). All the item values the code is trying to reference is located in code/page/mage/block/html/Pager.php. Pager.php has more information than I need view.phtml to have access to, so should I have view.phtml access pager.php or cut out the information I need and put it in a new .php file and have view.phtml find that?

If someone could point me towards the information I need to make this work, or write up a solution to my problem that I can learn from would be greatly appreciated. Hope I’ve explained what I’m trying to do well enough, thanks for the help guys and gals.

Image Attachments
magentohelp1.jpgmagentohelp2.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
MageParts
Guru
 
Avatar
Total Posts:  415
Joined:  2007-11-18
 

Try changing

$this->getLastPageNum()

To

Mage::getBlockSingleton('page/html_pager')->getLastPageNum();
 
Magento Community Magento Community
Magento Community
Magento Community
 
Jeffrey2
Member
 
Total Posts:  38
Joined:  2009-02-09
 

sorry sir does not work, it stops the whole right side from showing up.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jeffrey2
Member
 
Total Posts:  38
Joined:  2009-02-09
 

Bump. Come on people, I know this is very basic magento stuff, someone please point me towards a solution for a similar problem or the information I can learn to do this from.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jeffrey2
Member
 
Total Posts:  38
Joined:  2009-02-09
 

Bump. Getting answers to simple questions on here is hard.

 
Magento Community Magento Community
Magento Community
Magento Community
 
l781
Sr. Member
 
Total Posts:  109
Joined:  2008-11-09
 

for me it is interesting too....

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jeffrey2
Member
 
Total Posts:  38
Joined:  2009-02-09
 

6 Days and no answer, anyone who’s ever modded a template should know how to do this…

Now if Magento had Any sort of decent documentation on making or modifying templates I could teach myself this.
Worst documentation ever? I think so.

This is really setting me behind. Someone please help!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jeffrey2
Member
 
Total Posts:  38
Joined:  2009-02-09
 

Bump. Getting answers is harder than pulling teeth.

I also plan on moving the category-head & table class="pager" out of div id="main" also known as the right column and into div class="middle col-2-left-layout”, it should be the same concept as my above question so if someone could point me in the direction of some tutorials or other information I could learn from would be greatly appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jeffrey2
Member
 
Total Posts:  38
Joined:  2009-02-09
 

bump. so tired of bumping.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jeffrey2
Member
 
Total Posts:  38
Joined:  2009-02-09
 

bump. I’d really like to make these modifications to my template lol.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jeffrey2
Member
 
Total Posts:  38
Joined:  2009-02-09
 

This is one of the most basic template changes you can make. Can someone please just tell me how to do it or point me to a good resource?
I don’t have 5 hours to dig through the forums and play around trying to find the answer on my own especially when I know hundreds of people already know how to do this.

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