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

Disappearing buttons
 
themobilephonesite
Jr. Member
 
Total Posts:  25
Joined:  2008-08-11
 

Hi,

I have created some images for button, (I can not get my head around CSS) they work fine on the come page but not on anyother page as the images disapear leaving just the links and text. I can not understand why this would be as the code is not in the homegae cms. I have inserted the code into the right_col.phtml and left_colphtml.

The images are uploaded to the server directly and there is no reference to the home page, yet the button disappear in any page other then home.

here is the code in right_col.phtml,

<centre><a href="http://www.themobilephonesite.com/yessim.html" /><img src="skin/frontend/default/mytheme/images/template.gif" alt="testbutton" title=" All major credit and debit cards accepted " width="195" height="24" /></centre
<
div class="box">
    
<?php if (strtolower(substr($this->getLinkUrl(),0,4))==='http'): ?>
        
<a href="<?php echo $this->getLinkUrl() ?>">
    
<?php elseif($this->getLinkUrl()): ?>
        
<a href="<?php echo $this->getUrl($this->getLinkUrl()) ?>">
    
<?php endif ?>
    
<img src="<?php echo $this->getSkinUrl($this->getImgSrc()) ?>" width="195" alt="<?php echo $this->__($this->getImgAlt()) ?>" style="display:block;" />
    
<?php if ($this->getLinkUrl()): ?>
    
</a>
    
<?php endif ?>

</div>

Thank you

Image Attachments
vbtn.jpgdbtn.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
themobilephonesite
Jr. Member
 
Total Posts:  25
Joined:  2008-08-11
 

Anybody ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
themobilephonesite
Jr. Member
 
Total Posts:  25
Joined:  2008-08-11
 

help please somebody ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

You need to change your image source to:

src="<?php echo $this->getSkinUrl ?>images/yourimagename.gif"

Once it goes inside a directory it’s not getting the correct path the way you currently have it set up.

 
Magento Community Magento Community
Magento Community
Magento Community
 
anthonyfojas
Member
 
Total Posts:  33
Joined:  2008-08-19
 

You have an img src of ‘skin/frontend/default/mytheme/images/template.gif”, which is relative to the current url.  On the homepage, this would correctly translate to http://www.themobilephonesite.com/skin/frontend/default/mytheme/images/template.gif.  On your other page it would translate to http://www.themobilephonesite.com/bluetooth/handsfree/skin/frontend/default/mytheme/images/template.gif.  You need to do what sherrie said, except that getSkinUrl is a function, so “<?php echo $this->getSkinUrl() ?>”.

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