arteman (arteman) wrote in lj_userdoc,

How to display AdSense in custom styles

Here is a rough draft for the reserved faq #303:

If you have your journal style customized, to display Your Journal - Your Money ads on your journal pages, you need to call the "print_ad_box(string type)" method of the Page class in the code of your layout layer. Where 'string' is defining ad format as follows

'' for [[gmlitem:/manage/settings/index.bml.setting.adsense.horiz_top]]
's2.vertical' for 160x600
'' for 300x250
's2.bottom' for [[gmlitem:/manage/settings/index.bml.setting.adsense.horiz_bottom]]

To add html code around the ad block, viewer_sees_ad_box(sting type) clause could be used. Where 'string' is an appropriate banner value.


The following code could be used to display the [[gmlitem:/manage/settings/index.bml.setting.adsense.horiz_bottom]] banner:

var Page p = get_page();
if (viewer_sees_ad_box("s2.bottom")) {
   "<div class=\"ad\">";
Tags: cat-cust-adv, status-rejected

  • FAQ232

    There is a typo (or two) in FAQ232. I'm talking about the following sentence: Ddd them to your Friends list them with the Add Friend button at…

  • New FAQ: How do I deal with spam?

    This FAQ is meant to tie together all of our spam-related information, currently spread over several different categories. Ideally, I'd like to have…

  • Identity Account FAQs

    As LiveJournal Support regularly uses the term identity accounts both in answers to users and amongst themselves, and some system pages refer to…

  • Post a new comment


    Comments allowed for members only

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded