Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • the1michaeljones Friend
    #197075

    Im trying to apply an image to a button link, that takes you to Amazon on the Ja_Appolio template I have the button css image in a stylesheet called amazon_button, which is also the button class. The code for the button in the php com_content article document is

    <?php if($exts[‘amazonsell’]):?>
    <a class=”btn btn-source btn-buy” href=”<?php echo $exts[‘amazonsell’];?>”><?php echo JText::_(‘TPL_BUY_ON_AMAZON’); ?></a>
    <?php endif;?>

    This button code does work by clicking (‘TPL_BUY_ON_AMAZON’). How do you apply the button image stylsheet to this code, so that the image shows instead of the text.? Any help or ideas is appreciated.

    swissa Friend
    #532438

    I would try doing it with css in custom.css

    Font size 0 will hide the text and then you give it a background.

    Something like


    .btn.btn-source.btn-buy {
    font-size: 0;background-image: url('myimage.png');
    }

    Haven’t tested it and don’t have an amazon button but may be worth 2 minutes of your time. 🙂

    the1michaeljones Friend
    #532453

    Thanks for the reply Swissa. Gave it a try, and it caused the link to go blank. Im not sure if it’s because the url is going to a stylsheet that is the button. I changed the button class to .btn.btn-source.btn-buy, to make sure that everything linked up too. Im not sure if perhaps I should put something in the header like
    $doc =& JFactory::getDocument();
    $doc->addStyleSheet( ‘http://www.example.com/css/mystylesheet.css’ );

    and relate that to the code somehow. Nonetheless, thanks for the reply.

    swissa Friend
    #532506

    If it caused it to go blank then the css is working. I’d check the url path for the image. Try using /css/images as the place to store the image and call it from there.

    Good luck

    the1michaeljones Friend
    #532545

    Thanks again. Ill play with the path and see what I get.

Viewing 5 posts - 1 through 5 (of 5 total)

This topic contains 5 replies, has 2 voices, and was last updated by  the1michaeljones 10 years, 6 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum