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

How to add banners /ads or manage banners/ads ? 
 
alexandros Xynaris
Jr. Member
 
Total Posts:  15
Joined:  2009-05-30
 

How can i add banners/ads or manger banners on magento. I have 3 columns layout and there is a banner that i want to change it ow can i do it ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
robin2160
Moderator
 
Avatar
Total Posts:  1046
Joined:  2009-02-15
Berlin / Germany
 

On the right site:
app\design\frontend\default\default\template\callouts\right_col.phtml

on the left side:
app\design\frontend\default\default\template\callouts\left_col.phtml

Hope this helps wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

I added a simple XML file to manage my ad’s, I then placed them all in a folder and made a template that read them into the sidebars

The rotate on a random basis.

Midwest Hydroponics

 
Magento Community Magento Community
Magento Community
Magento Community
 
travelingwilly
Sr. Member
 
Total Posts:  85
Joined:  2009-03-21
 

Do you have the basic code for that..

w

 
Magento Community Magento Community
Magento Community
Magento Community
 
Adjustware
Guru
 
Avatar
Total Posts:  654
Joined:  2009-05-11
 

Hi,
What do you think about using OpenX with a magento based store?  Have anybody already got them working together?

 
Magento Community Magento Community
Magento Community
Magento Community
 
grooves1200
Sr. Member
 
Total Posts:  122
Joined:  2008-02-01
 

Hi Brent,

If you can share your code that would be great. I tried setting up a rotator based on this blog post:

http://inchoo.net/ecommerce/magento/simple-random-banner-rotator-in-magento-using-static-blocks/

But I can’t get it to display the ads.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

Ok, it is not very “PRETTY” code, but it works, my next step is to put it into the database and also include flash

Here is the XML file that holds the images

<?xml version="1.0" encoding="utf-8" ?>
<BanAds>
  <
ads>
    <
url>http://www.midwestsupplies.com</url>
    
<target>_blank</target>
    <
imgurl>/skin/frontend/default/custom/images/media/ads/MidSup.jpg</imgurl>
    <
width>207</width>
    <
height>100</height>
    <
alt>Midwest Supplies</alt>
  </
ads>
  <
ads>
    <
url>http://www.midwestsupplies.com</url>
    
<target>_blank</target>
    <
imgurl>/skin/frontend/default/custom/images/media/ads/MidwestAd2.gif</imgurl>
    <
width>207</width>
    <
height>100</height>
    <
alt>Midwest Supplies</alt>
  </
ads>
</
BanAds>

I didn’t include all the ads, you can add as many as you want.

I created a simple block in Catalog.xml

<reference name="banad">
        <
block type="catalog/adbanner" name="catalog.banad" template="catalog/adbanner/banAd.phtml" />
  </
reference>

Ok, here is the really ugly part, I was a SQL programmer and you will have to excuse my rudimentary PHP red face

<div class="box base-mini">
<?php
    
try{
$file 
"/home/midwesthydro/public_html/app/design/frontend/default/custom/layout/banad.xml"
 
$bannerAd simplexml_load_file($file);
//echo $xml->getName() . "<br />";

$adCount count($bannerAd);
$randomAdNumber mt_rand(1$adCount);
//echo $randomAdNumber;
$i =1;
$j =1;

//Loop through array becuase I don't know how to pick one element out of the top array! 04/28/09
foreach($bannerAd->children() as $littlens)
{
    
    
if($i == $randomAdNumber){
        
foreach($littlens as $child){
            
            
//created this switch becuase I don't know how to pick one element out of the child array! 04/28/09
            
switch($j){
                
case 1;
                    echo 
'<a href="' $child '"';
                    break;
                case 
2;
                    echo 
' target="' $child '">';
                    break;
                case 
3;
                    echo 
'<img src="' $child '" ';
                    break;
                case 
4;
                    echo 
'width="' $child '" ';
                    break;
                case 
5;
                    echo 
'height="' $child '" ';
                    break;
                case 
6;
                    echo 
'alt="' $child '"></a>';
                    break;
                default;
                    break;
            
}
            $j
++;
        
}
    }
    $i
++;
}

}
catch(exception $e)
{
    
    }
?>
</div>

I have learned a lot since and will be putting newer version on our newest site.

Beta Midwest Supplies.com

I think that is it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
grooves1200
Sr. Member
 
Total Posts:  122
Joined:  2008-02-01
 

Has anyone tried the Inchoo.net method in the above link? I still can’t get anyone over there to explain why i can’t see any images after i make the code changes they suggest.

 
Magento Community Magento Community
Magento Community
Magento Community
 
grooves1200
Sr. Member
 
Total Posts:  122
Joined:  2008-02-01
 

>>bump>>

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

My method took less than an hour to implement.  I have even cleaned up the code!

 
Magento Community Magento Community
Magento Community
Magento Community
 
M_CS
Member
 
Avatar
Total Posts:  44
Joined:  2010-06-08
San Jose
 

Here is the link to free ad banner manager with lots of admin setting for good usability - http://www.magentocommerce.com/magento-connect/catalog/product/view/id/14158/

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