how to add google adsense and html to my site

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

how to add google adsense and html to my site

uborkingsley
please i need help on how to add adsense code or html to my site
Reply | Threaded
Open this post in threaded view
|

Re: how to add google adsense and html to my site

GregChapman
The easiest place to add at HTML code, for adsense or other reasons, is in any forum or sub-forum Description area. Just check the "Description is in HTML Format" box.

If you want to add it elsewhere then you need to learn how to edit the NAML macros that generate Nabble's pages.
Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!
GregHelp - Building a set of answers to Nabble FAQs.
Reply | Threaded
Open this post in threaded view
|

Re: how to add google adsense and html to my site

Harvey
GregChapman wrote
The easiest place to add at HTML code, for adsense or other reasons, is in any forum or sub-forum Description area. Just check the "Description is in HTML Format" box.
I had no idea this was so easy this is very useful to me I got it to work on the forum home page, but when I post it in the sub forums even with the HTML box checked I don't get an ad I get the code showing through. any ideas?
HTTPS Please!
Reply | Threaded
Open this post in threaded view
|

Re: how to add google adsense and html to my site

Harvey
I figured out the code issue (sorta)  but when you use the ad in a subforum it comes through onto the main page and breaks several things:

HTTPS Please!
Reply | Threaded
Open this post in threaded view
|

Re: how to add google adsense and html to my site

Harvey
In reply to this post by Harvey
I figured out the code issue (sorta)  but when you use the ad in a subforum it comes through onto the main page and breaks several things:



As far as resources are concerned I care way more about HTTPS than this. But if it is an easy thing for me to fix...
HTTPS Please!
Reply | Threaded
Open this post in threaded view
|

Re: how to add google adsense and html to my site

Harvey
The idea of using the forum description area is great.  I'm only using it at the top level because in sub forums it shows on the main page, like in the image above.

Any way to prevent this?  If I could use an ad at the top of each sub forum that would be great. Any code for this?
HTTPS Please!
Reply | Threaded
Open this post in threaded view
|

Re: how to add google adsense and html to my site

GregChapman
None of my forums are commercial so I don't use adverts on any of them and hadn't tested my suggestion, but now I think about it, adding adsense code to the Description Area will have problems with the Category app and others that display the Description Area contents for sub-forums.

When I get home from the trip I am currently on will see if anything I can think of works. At the moment my hope is that it I can use a CSS class that detects the different structure on pages listing sub-forums and when used in that context sets the advert not to display.
Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!
GregHelp - Building a set of answers to Nabble FAQs.
Reply | Threaded
Open this post in threaded view
|

Re: how to add google adsense and html to my site

GregChapman
This seems to work for me when the top level app is "Category"...

At the top level go to: Options > Application > Change Appearance > CSS
and enter the following:
span.node-snippet div.adsense {
  display:none;
}
Then in your sub-forum description, check the "Description is in HTML Format" box and try something like this:
<p>The is a Sub Forum to test Adsense code.</p>
<div class="adsense">Here is where the Adsense code goes</div>
NOTE: Having the description to display as a paragraph (within "p" tags) defaults to showing a 1em margin under the paragraph. That may not be desirable on the top level app unless all sub-forum descriptions are set to be HTML and also include "p" tags. Also, depending how the adsense code is written, it may be preferable to dispense with the "p" tags in the description.

Let me know about any issues. (Remind me of your forum URL so I can check your code, in case the issues are caused by your existing customisations. I can then make sure a forthcoming post on GregHelp will cover such possibilities.)
Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!
GregHelp - Building a set of answers to Nabble FAQs.
Reply | Threaded
Open this post in threaded view
|

Re: how to add google adsense and html to my site

GregChapman
I think I've found your adsense code. If it looks similar to that below and starts with "div" then all you should need to do is add my CSS code the class=adsense expression to the first tag in your existing adsense code  (as I have done below):

<div class="adsense" style="margin: 14px -4px 8px -4px;">
Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!
GregHelp - Building a set of answers to Nabble FAQs.