I was wondering if anyone can help me as I can't code to save my life. I am trying to insert a 200x200 Google adsense ad into my content so that the text wraps around. Specifically I want a left justified ad with a bit of a margin around it that is in the first part of content of each page.
Adsense module for 6 isn't running yet. No word if or when injector will come. I tried a few hacks I read in various places but they don't work in Drupal 6. I got about 75% there with hacks but it didn't work enough to put in production.
Here is what I got 75% working. Something still goofy because it only showed up properly on front page. On other pages all the content move over to the right in IE and in Firefox the ad showed up centered.
I'm running Garland theme. In my page.tpl.php file I inserted the following.
In between
print $content
Again, this works exactly the way I want on the front page in IE and Firefox but goes pear shaped on other pages with IE and Firefox having different reactions.
Comments
Ok so the above code didn't
Ok so the above code didn't show up because I forgot to code it out.
The inserted code in page.tpl.php is
which I placed between
I also tried to use an example using style.css someone posted for use in Wordpress but that didn't work either
and then putting
in page.tpl.php but it never worked either.
node.tpl.php?
if you want it in the content you could put it in node.tpl.php above the call to $content in a span that you float:right
~silverwing
_____________________________________________
Land of Midnight | MisguidedThoughts | showcaseCMS
Perhaps I didn't do it right
Perhaps I didn't do it right but when I put the adsense code in the node file it was at the beginning of all the individual posts on each page which is not what I want and violates the TOS for Adsense because it tries to put more than 3 ads per page.
put it in...
<?php if ($page != 0): ?> <?php endif; ?>But it in the middle of that to get it set when it's only on an individual post.
~silvewring
_____________________________________________
Land of Midnight | MisguidedThoughts | showcaseCMS
Thanks I'll try that but
Thanks I'll try that but unless I am mistaken it won't show up on the first page then correct? So I need to do 2 things? Can you give a few more details?
Try using a
Try using a node-NID.tpl.php, where the NID is the node id # of the node you want it on
Well that line worked for
Well that line worked for anything besides the front page so I suppose I could add the same code on the page.tpl.php with =0 so it only shows up on front page. It still doesn't look great if the content isn't very long because of the formatting done by Drupal. It literally looks like it is hacked right in there. I guess I'll have to wait for the module+injector :(
The only way I was able to
The only way I was able to get anything to work close to what I wanted was to float right instead of left. It just refused to work float left on anything other than the front page
and here is my website. It's still not perfect as you can see on the forum page but good enough for now.
www.powerpbx.org
hey can you please explain
hey can you please explain me in detail how can where should i insert the code to get the ad to display like that i dont know coding but if you can give me the sample code and where to insert then i will be able to do that
i hope you will help me out on this
i have one more questions how come the ad is not not showing up on the other postings because if i am not wrong then everytime you have a new post it is a new page ?
I explained that in post #1.
I explained that in post #1. Between that and my previous post you have all the info you need. I'm not a coder and if I can figure it out anyone can. It's not working perfectly. if you look on multiple pages on my site you will see a bit of goofy behaviour.
The important thing is since adding that wrap around ad yesterday my click through rate is up 50% today so it's worth it for my site.
so can i add this code
so can i add this code anywhere on my page or there is some specific place where i have to add the code ?
This worked for me
I am using Drupal 6.8 and the newest Adsense module and injector. I placed the following code in the adsense injector field located /admin/settings/adsense_injector
<div style=display:block;float:left;margin: 5px 10px 5px 10px;>//adsense code here</div>Appears to work well with no mods needed.
Thanks for the info. Now
Thanks for the info. Now that Adsense module and injector are ported to D6 it simplifies things quite a bit. I'll give your code a try.