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

Where do the links come from?!?! 
 
Michal_s
Sr. Member
 
Total Posts:  111
Joined:  2008-05-15
The Netherlands
 

I was editing the list.phtml file when the strangest thing happend:

This is how i want the html:

<div class="display-product">
            <
a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>">
            <
img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(300, 155); ?>" width="300" height="155" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" />
             
            <
div class="display-content"
            <
h1 title="<?php echo $this->htmlEscape($_product->getName()) ?>">
            
<?php echo $this->htmlEscape($_product->getName()) ?>
            
</h1>
            <
span class="type"><?php echo $this->htmlEscape($_product->getSKU()) ?></span>  
           
            </
a>
            </
div>
         </
div>

nothing exiting, you’d think, this is what the frontend shows

<div class="display-product">
            <
a href="http://www.###.nl/shop/audio/headset/test-product-3.html" title="Altec coole headset ">
            <
img src="http://www.###.nl/shop/media/catalog/product/cache/1/small_image/300x155/5e06319eda06f020e43594a9c230972d/d/i/display-altec-lansing-3.png" alt="Altec coole headset " width="300" height="155">
             
            </
a><div class="display-content"><a href="http://www.###.nl/shop/audio/headset/test-product-3.html" title="Altec coole headset "
            </
a><h1 title="Altec coole headset ">
<
a href="http://www.###.nl/shop/audio/headset/test-product-3.html" title="Altec coole headset ">            Altec coole headset             </a></h1>
<
a href="http://www.###.nl/shop/audio/headset/test-product-3.html" title="Altec coole headset ">            <span class="type">kguj 3000</span>  
           
            </
a>
            </
div>
         </
div>

Wher the hell do all the links come from? the first link iis the only one which is placed in the list.phtml

 
Magento Community Magento Community
Magento Community
Magento Community
 
Michal_s
Sr. Member
 
Total Posts:  111
Joined:  2008-05-15
The Netherlands
 

looks like magento alters my code when i try to use a <div> inside an <a> tag, i agrea that this is not the correct way to code but if i want it that way, then it should be possible

 
Magento Community Magento Community
Magento Community
Magento Community
 
Michal_s
Sr. Member
 
Total Posts:  111
Joined:  2008-05-15
The Netherlands
 

got this fixed trough a html/css workaround, but i still think that magento should not alter my code

 
Magento Community Magento Community
Magento Community
Magento Community
 
Kerry Hatcher
Sr. Member
 
Avatar
Total Posts:  96
Joined:  2008-07-15
Macon, GA
 

I’m having a similar issue, I’m trying to get the images to show up above the item names. What was your workaround?

Thanks,

 
Magento Community Magento Community
Magento Community
Magento Community
 
nikefido
Guru
 
Avatar
Total Posts:  481
Joined:  2008-07-11
New Haven, CT
 

Do you have cacheing on?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Michal_s
Sr. Member
 
Total Posts:  111
Joined:  2008-05-15
The Netherlands
 

nope cache is off.

Kerry: you have to give all the attributes a <a> tag, this was how i finaly fixed it

<div class="display-product">
            <
a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>">
            <
img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(300, 155); ?>" width="300" height="155" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" />
            </
a>
             
            <
div class="display-content"
             <
a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>">
            <
h1 title="<?php echo $this->htmlEscape($_product->getName()) ?>">
            
<?php echo $this->htmlEscape($_product->getName()) ?>
            
</h1>
            <
span class="type"><?php echo $this->htmlEscape($_product->getSKU()) ?></span>  
            </
a>
            </
div>
         </
div>

then work with position absolute and widths, as you can see <span> does work without magento intervering

 
Magento Community Magento Community
Magento Community
Magento Community
 
Kerry Hatcher
Sr. Member
 
Avatar
Total Posts:  96
Joined:  2008-07-15
Macon, GA
 

I will give that a try!

Thanks,

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