This object is in archive! 

HOw to embed Google Adsense in an Answer?

Archived Amalgam V. 12 years ago

How can I add a google adsense ad into my answer?


I'd also like to include other pieces of javascript into the answers ( moderator feature only ) . Supported now?


Thanks!

Best Answer
photo

Any code could be inserted into override templates inside theme or inside templates in system, but they will be overwritten after update.

Some templates are stored in /application/templates/layout/ and some in application/templates

Also each module can have there own templates that are located in /application/modules/[modulename]/templates

Please check Themes Customization article on how to override theme based on default one.

Replies (10)

photo
1

This question is still outstanding.... this is a very important feature for me.

photo
1

Amalgam Virgo wrote:

This question is still outstanding.... this is a very important feature for me.
We'll reply you possibly on Monday, as paid customers are more priority to us.

photo
1

Any code could be inserted into override templates inside theme or inside templates in system, but they will be overwritten after update.

Some templates are stored in /application/templates/layout/ and some in application/templates

Also each module can have there own templates that are located in /application/modules/[modulename]/templates

Please check Themes Customization article on how to override theme based on default one.

photo
1

I'd like to be able to insert scripts and iframes into individual posts/answers. This would allow for youtube, adsense, other banner serving apps etc. Sometimes you want ads in one answer but not in another. So being able to embed scripts into an individual post gives the most granular control. Thanks for considering it.

photo
1

I'm still waiting for a final answer on this question... is this possible yet? Thanks!

photo
1

Take a look at \application\modules\resources\templates\_comment.phtml on line 30 - the line where each answer will be printed. It uses view helper \application\modules\system\helpers\Bbcode.php where you can change tag filtering rules to except needed tags or tags combinations.

photo
1

Thanks, sorry I didn't receive e-mail notification that this post has been updated...


So assuming I followed your instructions and allowed the script tag... would that be only for moderators and administrators or would it be for everybody?


thanks very much!

photo
1

It would be for everybody

photo
1

So I'm looking at the Bbcode.php file but have to admit that I'm not proficient with php or regular expressions. If you could find a moment to provide the code to append to Bbcode.php It would be much appreciated!

photo
1

Paul Yakubets wrote:

Take a look at \application\modules\resources\templates\_comment.phtml on line 30 - the line where each answer will be printed. It uses view helper \application\modules\system\helpers\Bbcode.php where you can change tag filtering rules to except needed tags or tags combinations.
So I'm looking at the Bbcode.php file but have to admit that I'm not

proficient with php or regular expressions. If you could find a moment

to provide the code to append to Bbcode.php It would be much

appreciated! Thanks!

Replies have been locked on this page!