Posted by g10tto on May 7, 2009 at 7:39pm
Jump to:
| Project: | Advertisement |
| Version: | 6.x-2.x-dev |
| Component: | ad_embed module |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
Is there a method of placing ads into a newsletter using the ad_embed module or otherwise, without resorting to a linked image?
I am aware of the three methods for embedding an ad into content, but all three seem to call JavaScript to serve the ads.
Is this correct, and is there an alternative, given that JavaScript is not read by most email clients?
Thanks!
Comments
#1
Hi I'm having the same issue, I have a page themed specifically for a newsletter, with all styles inline and absolute paths to all images, I have some ad's hard themed into the page, but since they are called with javascript, the newsletter can't create the ad's...
<div class="advertisement group-tids-65" id="group-id-tids-65"><script type='text/javascript' src='http://www.example.com/sites/all/modules/ad/serve.php?q=1&t=65&u=node/149'></script></div>I need the code to generate just a regular hard coded image tag inside an , like what the browser ultimately creates using javascript
Like this...
<div id="ad-179" class="image-advertisement"><a href="http://www.example.com/ad/redirect/179/t65?url=node/149"><img width="300" height="250" title="Test Deli" alt="Test Deli" src="http://www.example.com/sites/default/files/test_deli.jpg"/></a></div>I tried changing the method to raw, but it still uses javascript to create the ad... is there a workaround we can use for newsletter integration?
Thanks for your time, this module is otherwise PERFECT
#2
Remote ads are always displayed with JavaScript so that the ads change each time the "page" is displayed. If you want to use the raw method to display ads, then the same ad will always be displayed in the same place whenever the newsletter is displayed. If this is what you want, locally display the ads in raw mode then cut and paste the resulting HTML into your newsletter -- does that give you what you're looking for?
#3
...the resulting HTML contains javascript calls, and this situation is not suitable for email newsletters. I'm taking gregarios idea from here: What if we could put some code like this
<a href="http://mydrupalsite.com/.../serve.php?type=remotegroup&groupname=mydestinations"><img src="http://mydrupalsite.com/.../serve.php?type=remotegroup&groupname=myads" />
</a>
to invoke a specific ad on my site?
Is there a workaround for this? Or another module that can accomplish this?
I have a website with advertising in the pages different from the ads that ships with the email newsletters. This GREAT module fulfills all my needs, with the only exception that the advertising are not showing up in the email newsletters due to the need of javascript to serve the ad.
#4
Hi,
I've managed to embed ads in a simplenews newsletter using a combination of the following :
* CCK node reference field
* phptemplate_preprocess_simplenews_newsletter_body() function
* editing the simplenews-newsletter-body.tpl file
I ran in to problem attempting to serve the ad via any of the proper methods i.e. :
$variables['ad_top'] = ad(NULL, 1, array('nids' => $variables['node']->field_ad_468x60[0]['nid'], 'ad_display' => 'raw', 'cache' => 'none'));
Didn't work for me. Instead I had to include the image manually with something like :
$ad = node_load($variables['node']->field_ad_468x60[0]['nid']);
$variables['ad_top'] = sprintf(
'%3$s',
$ad->redirect,
$ad->tooltip,
$ad->ad
);
Not brilliant but does the job.
Using the former method worked for all other ad_display types (e.g. jquery, javascript, etc) none of which can be utilised in a newsletter. I did find why the raw method wouldn't work but it proved too much of a rewrite of core module code.
If you want more code examples of how I managed it let me know.
#5
Wow I posted this problem a year ago and fortunately never HAD to have the functionality until now, and here you've solved it for me. If it works (and based on how you described it I think it will), you've totally made my day/week/month.. PLEASE post any working code examples that you have, thank you thank you.
#6
Thank you fr33dom!
It seems that the ads are displayed only once.
Simplenews uses cron.php to send newsletters.
The second time an ad is going to be displayed it is not validated by adserve_cache_validate() in adserve.inc because its node id is in the $displayed array.
What I think the developer should do is to find a way to reset the static $variables used in adserve_variable() when ad() is called.
#7
Subscribe
#8
Subscribe
#9
Is there a solution for this yet?