By gwiley - July 2, 2010

Since I can't add Ad Code that uses Javascript directly into my Content field (gets remarked out during the publish step), is there a way a placeholder could be added so that the code could be added there, then a placeholder like ***ad1*** could be stuck into the content area (like ***image#*** and it gets processed when published? The code added into the Ad placeholder would be in PHP that would run through my Ad Manager software to display an Ad that would be either Javascript or HTML.

The purpose would be to put an Ad Group code into the content. This Ad Group code would be in PHP to be able to display ALL types of ad code. That Group Code would be a group related to that particular article's content, like fishing. Only fishing related Ads would display and would be either random or contextual based depending on what my Ad Management software figured would be best.

I've added the PHP code in the template of the Article Page, but all the ads appear a the bottom of the article, I'd rather have them in the content area itself.

Any suggestions?

Re: [gwiley] Placeholder for Ad Code

By Kimber - August 25, 2010

I wrap ad codes of google adsense using

I put the codes right above the content placeholder I want the ads to appear in and the ads appear in the content.

Re: [Kimber] Placeholder for Ad Code

By gwiley - August 25, 2010

Thanks for the reply, Kimber! Unfortunately, I don't fully understand what you're doing, though. Are you using the My Placeholders page, creating a new placeholder, i.e. my.googlead, and adding your google ad code and inserting that placeholder, i.e. $my.googlead$, directly into the content area where you type the article?

If not, do you have sample code of what you're doing?


Re: [Kimber] Placeholder for Ad Code

By gwiley - August 25, 2010

I see what you're doing. It's not *exactly* what I was looking for, but closer than what I have now. Thanks very much for your input! I was hoping more for placing it anywhere in the content area just not wrapped around the top or the bottom in some fashion. But, that'll bring my Ad up from the bottom of the page and make it look more integrated than in the disjointed fashion it is now.

Thank you very much! I owe ya one!

Re: [gwiley] Placeholder for Ad Code

By Kimber - August 25, 2010

I use to use Article Manager as my primary web site software and that is the closest I have ever gotten to getting the ads in the content. I know some place on the forum, if you search, there is an article on making ad show up much ever so many paragraphs so you might try searching the forum for that article.

Re: [Kimber] Placeholder for Ad Code

By gwiley - August 25, 2010

I found the article you're talking about. I can use that to do EXACTLY what I wanted. Thanks!

For those that need it, here's what I did. It wrapped the text in the content area around a 250x250 Google Ad with a right-justify a couple paragraphs down. Embedded all snug.

1. Connect with your web server and look for the "articlePage.html" template file, this file can be found inside the /templates/articlePages/ directory. :)

2. Open up this template file and look for this bit of code:


Change it to this:


<!-- templateIf: $article.content:limitParagraphs(2)$ ne "" -->

<div style="display:block;float:right;margin: 5px;">
<!-- Place your Adsense code here BEGIN-->
!!!Google Code HERE!!!
<!-- Place your Adsense code here END-->

<!-- /templateIf -->


This is what it looks like:

Re: [gwiley] Placeholder for Ad Code

By Kimber - August 26, 2010

Happy to help