arteman (arteman) wrote in lj_userdoc,
arteman
arteman
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

's2.top' for [[gmlitem:/manage/settings/index.bml.setting.adsense.horiz_top]]
's2.vertical' for 160x600
's2.box.top' 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.

Example


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\">";
   $p->print_ad_box("s2.bottom");
   "</div>";
}
Tags: cat-cust-adv, status-rejected
Subscribe
  • Post a new comment

    Error

    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 

  • 7 comments