Widget for Adsense

Topics: Controls
Jul 26, 2008 at 8:37 AM
Hi

How can i create a sideBar widget for Google Adsense??

regards

Bharat Mudgal
Aug 7, 2008 at 4:29 AM
Edited Aug 7, 2008 at 4:29 AM

Hi,

In whatever theme you're using, open the file SidePanel.ascx using a simple text editor like notepad.

After the line

<% if (Page.User.Identity.IsAuthenticated)
   { %>

insert the information that comes from adsense.  In the code below, I simply named it "Advertisers"

<div class="links">
    <br />
    <h2>
        Administration</h2>
    <uc1:menu ID="Menu1" runat="server" />
</div>
<%} %>

<div id="Advertisers" class="dbx-box widget_categories">
    <h3 class="dbx-handle">
        Advertisers</h3>
    <div class="dbx-content">
<script type="text/javascript"><!--
google_ad_client = "pub-5825953504944796";
/* Blog 200x200, created 6/15/08 */
google_ad_slot = "4207729069";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</div>

Of course, the code you get from google will be different and the pub-.... will be your own identifying number.

Hope this helps or at least leads you in the right direction.

Sep 22, 2008 at 8:24 PM

Hi

Thanks for your reposnse. But there is no "sidePanel.ascx" file in the Standard theme folder.

The only files are

CommentView.ascx
postView.ascx
site.master
site.master.cs
style.css

Please check the site layout at www.stockmode.com/tech

regards

Bharat Mudgal

Sep 23, 2008 at 5:15 AM
yeah there is no sidePanel.ascx file in the entire solution.

in spite of i found the following line

    <div id="sidepanel">
      <blog:WidgetZone runat="server" ID="rightzone" />
    </div>

by this way they are showing widget in the side panel.

even i need ad sense in my site at www.newGenLives.com

Thanks

Jitendra Singh
Sep 23, 2008 at 6:04 AM
I put a a piece of code after     <div id="sidepanel"> in site.master file. The result "tell a friend" widget can be seen at www.stockmode.com/tech
however, it still looks weird without the white background like in other side panels.

regards

Bharat Mudgal
Sep 23, 2008 at 6:46 AM
hi Bharat,

i think for the background, u need to create a seperate widget for tell a friend.
for that u just need to copy any of the existing widget and put the code that u put after <div id="sidepanel"> in site.master file.
and add that widget at run time.

i need one favour from your side, can u tell me the code u written for the "dig in, del.i...." after each post.
as before putting any of the content on my site, first i want to satisfy by my site design.

regards

Jitendra Singh
Sep 23, 2008 at 9:01 PM
Hello Jitendra

You can find a detailed tutorial for adding the social-bookmarking at http://www.dannydouglass.com/post/2008/01/Add-Social-Bookmarking-Links-To-Your-Blog.aspx

I found how to add a widget for Tell a Friend on my blog! I feel weird to have not thought of it earlier.

Log in to your blog with your administrator account.
To the right you will see a dropDown Menu. Choose TEXTBOX.
Click on HTML icon and insert the code. Save

thats it!

Do tell me later on how your site looks like. All the best!

take care

Bharat Mudgal    
Sep 24, 2008 at 5:02 AM
Thanks a lot !!