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

  • Update to FAQ 248

    I updated the "warning bar" at the top of FAQ 248 to reflect the fact that, although the FAQ is in the "Advanced Customizations" category, only…

  • embedding journal

    FAQ68 I think in the sentence "Most methods of embedding your website require that you know your style's identification number" - your website…

  • Account Types

    FAQ38 does not include a mention of Sponsored Accounts.

  • 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