Download & Extend

Any news about the Ad Image (ad_image) support?

Project:Ad Views
Version:6.x-1.0-alpha4
Component:Code
Category:feature request
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hello milesgillham,
Thank you for taking care of this useful module.
I have seen your road map but would like to know if you have an idea when you will implement the view support for ad_image?
Many thanks :)
JJ

Comments

#1

Glad you asked, and since you did, I've elevated the priority of this module (Roadmap also updated) and will include in the next release within a week or so. Earlier if I possibly can.

Regards,

Miles

#2

Dear Miles,
I am glad I asked as well then :) and thank you very much for this!
I am currently testing the text_ad view support, everything seems to be working fine. I will report if I see anything wrong.
Thanks again,
JJ

#3

Status:active» needs work

This is now partially implemented in ALPHA3 release - ad_image table only. Needed to push ALPHA3 out earlier as found a nasty typo that meant the Users relationship was effectively hidden.

Cheers,

Miles

#4

Thanks a lot Miles :)
JJ

#5

Dear Miles,
Any progress for the Ad Image function? I have tested what you have done so far in alpha3, everything seems to work, but cannot do much with it :):)
Many thanks!

#6

Time does fly, I've been distracted with other projects so your reminder was good. I'm working on alpha4 release right now, should be out soon once I've finished Ad Image and anything else I have time to include.

Cheers,

Miles

#7

@Delta: I've been working on the module, and I'm wondering what you cannot do with it? The ad_images table support is enabled, it was just the ad_image_format table that I hadn't put support in for, but that seems secondary. Can you give me an example of what you're trying to do with it and I think I'll be able to help more? Is it not displaying images for you?

Regards,

Miles

#8

Dear Miles,

I would like to create a view that would put all image ads from a specific ad group in a random way.
Very similar to what the ad module does with each block associated to a group.
I need a view though, so I can insert it in my newsletter.

I have been inserting all my ads with html in the newsletter until now. An image ad view would make life much easier :)

I have had another look today at your module, and I don't know why, but I cannot seem to make it work.

I create a new view and I select "Advertisement" for the view type and then:

1) First problem
In "Filter" I cannot see how I can restrict to one specific ad group.

2) Second problem
In "Fields", I would like to select the Ad image so that the images are displayed.
But the only fields related to Ad image that I can find are:
Ad Image: Remote image
Ad Image: URL URL
Ad Image: Tooltip Tooltip
Ad Image: Height Height

I have tried all of them but none displays the image.

I am probably doing something wrong and any help would be very much appreciated.
Thanks again Miles,

JJ

#9

Ok, I think I see. My fault, probably - I'm still learning Views myself. I think there needs to be a Node row display type. It might be possible with playing around with Views more but that would give you what you want. I'll write an advertisement node row handler. That will have the benefit of being themable also I expect.

Regards,

Miles

#10

Thanks a lot Miles :)

#11

@Delta: I've just checked into -dev what I believe is a big step forward for this module. I'll punch out a new release as this is good functionality.

I've added an "Advertisement" row style, it will support any Advertisement type, not just images. To use it:

  1. Create a new view based upon Advertisement
  2. You said you wanted just one ad so set "Items to display: 1"
  3. You said you wanted a random ad, so go to "Sort criteria" and go for "Global: random"
  4. Click on "Row style: Fields" and change it to "Advertisement". This is equivalent to choosing "Node" in other views, but Ads aren't quite the same.
  5. You can choose the way the ads are rendered (raw, iframe, jquery, javascript, default). FYI, javascript and default don't seem to work, but you'll get most of what you need out of raw (the default), iframe or jquery.
  6. You can then use the Filters section to choose how you want to select your ads. You'll most likely want to set an "Ad Type: image" to get your image ads.
  7. You may want to ad other filters to pin down particular ad groupings, that's up to you. The ad renderer will simply not display ads it thinks are invalid (eg expired or not approved), I think. So if you get blanks then that's what is happening.

I hope this helps you.

Regards,

Miles

#12

For those who are interested, this functionality required a little bit of work and certainly has increased my knowledge of Views:

  • Modification of ad_views.views.inc to implement hook_views_plugins() with ad_views_views_plugins()
  • Creation of ad_views_plugin_row_ad.inc to provide a plugin row handler ad_views_plugin_row_ad (extends views_plugin_row), mainly to manage options such as which Ad display rendering to use
  • Insertion into ad_views.module of template_preprocess_ad_views_view_row_ad() to get Ad to do the rendering of themed content for the template file to pick up.
  • Creation of ad-views-view-row-ad.tpl.php to display the themed output.

#13

Status:needs work» needs review

#14

I've added a default view to the dev bundle (as described above - just gives you a single random advertisement without frills).

Cheers,

Miles

#15

Fantastic Miles, I will check it out today and report here.
Many many thanks:)

#16

Hi Miles,
I still cannot make it work (:
1) I have followed your step by step procedure but no images come out.
2) Did not find the default view
3) In the filters, could not find a way to select the ads on a per group basis.

Here is the export of the view that I have made:

$view = new view;
$view->name = 'Ad_City';
$view->description = 'Ad_City';
$view->tag = 'Ads';
$view->view_php = '';
$view->base_table = 'ads';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('sorts', array(
'random' => array(
'id' => 'random',
'table' => 'views',
'field' => 'random',
),
));
$handler->override_option('filters', array(
'activated' => array(
'operator' => '=',
'value' => '1',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'activated',
'table' => 'ads',
'field' => 'activated',
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('style_plugin', 'list');
$handler->override_option('row_plugin', 'ad');
$handler->override_option('row_options', array(
'ad_display' => 'raw',
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'advertisements');
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
));

#17

Ah, rats. It's working for me, so will do some more testing.

Do make sure that the ads are eligible for display: published, active/approved, not expired. The default example is only in the -dev release, not in the alpha release. Also try the Unformatted style rather than List (although that shouldn't matter).

I'll try out your example on my own site, and I'll ask Jeremy if there's anything else I need to know as I'm using the Ad API for display/rendering.

So close!

Cheers,

Miles

#18

@Delta:

Okay, I've played with your export. Drop the "Ad: Activated = true" filter entirely and it should light up. It would seem reasonable to have that filter, however you can do "Ad: Status = active" which should do what you want. I need to understand how Ad module updates/sets the various flags to work out of Ad Views is misinterpreting or if there is a right way to do it. I will need to see my guru (Jeremy) or delve into the Ad tables and code a little further.

Let me know if that does it for you.

Update: There are a bunch of fields associated with an ad that in my implementation are zero. I think there is workflow that populates expired, autoexpired etc. You definitely only should worry about "Ad: Status" as the meaningful field.

Regards,

Miles

#19

@Delta:

On Ad Groups - that's handled by taxonomy. You can hammer Views into displaying only ads that are related to a certain taxononomy term id, but the nicer solution will be if Ad Views provides a more straight forward connection. I'll look into coding a helper so that selecting an ad group is more straight forward.

Update:
Ad module uses standard Drupal taxonomy (vocabulary & terms) to associate 0 or more terms to an ad, which defines what ads will be displayed in an ad group. (The term_node table provides the aid/nid <-> tid mapping). I think the trick will be to create a synthetic Ad View ad field which provides a pulldown of all registered ad groups so that you can just select the association in a View. Goody, I'm learning even more about Views!

Regards,

Miles
--

#20

I've just committed an update to the -dev release (nightly build, so it may not show up immediately) which has added groups support through taxonomy in a very drupal way. To select which ad groups you wish to see do this:

  1. Add a Filter for "Taxonomy: Term" (you'll see a bunch of extra filters such as Node - this is a good thing as although Advertisement is a new base type, it leverages from Node)
  2. At this point you can choose any taxonomy you like, but choose "Ad groups" as the Vocabulary, and "Dropdown" for "Selection type". Press "Update".
  3. And voila. You should see a selectable list of all Ad group types, giving you the last piece of the puzzle.

I'm going to add some fields to Ad Views for Ad Flash and then roll the whole thing up in a new release in the next couple of days. If you (and anyone else watching) can test out the -dev release I'd be keen to hear how your mileage is). Otherwise, I'll push out alpha5 tomorrow.

Regards,

Miles

#21

Version:6.x-1.0-alpha2» 6.x-1.0-alpha4

#22

Hi Miles,
Thanks for the work:)
I will do some testing on the dev and report here.
Thanks again,

#23

Status:needs review» fixed

Released in alpha5. Matching documentation updated in the module documentation page. Post a followup if any problems.

#24

Status:fixed» needs review

Hi Miles,
I cannot find the most recent dev version.
However, I have done some further testing with alpha4 and was finally able to get the images from the ad to be diplayed.

In the role style, after choosing advertisement ( you have a small typo here fyi: advertisment), I chose default instead of raw and that seems to do the trick.

Now what I really need, and I think would be useful for this module, is to have a taxonomy filter enabled. Would be good also to have a taxonomy option enabled for the argument section.

Many thanks MIles... we are getting there: I was very happy to be able to see the ads!!

#25

@delta: alpha5 release should give you the taxonomy option. Typos fixed in -dev branch (it only builds the -dev release nightly at midnight so there is a bit of lag there).

Regards,

Miles

#26

BTW, my bad - I'd been working in HEAD branch and -dev wasn't being updated. I became suspicious when I realised the -dev hadn't built after latest commits. Fixed now which means -dev release will be properly updated.

#27

HI Miles, I have found the dev and installed it.

Images are being displayed when I used the default option in advertisement row. A little bug when previewing the view: it opens the result on a new page rather than on the same page.

One bigger problem is that I cannot use the taxonomy filter. Will open a new issue for this so things don;t get mixed up :)

Thanks a lot Miles :):)

#28

The "Live Preview" is opening a new page? Are you using "Default" or have you created a "Page/Block/etc."? Either way, it shouldn't pop up a new page to preview. Let's nail the taxonomy filter then pleased to work out what's happening with the preview, which should be controlled by Views rather than anything ad_views dishes up. Strange!

Regards,

Miles

#29

Priority:normal» critical

The same is happening with me. I cloned the Random Ad view to a new one. Created a "default" and a "block" view. View is filtered by taxonomy term to the Ad Group name. Regardless of what kind of "style" is used, if javascript is active in the browser, it forces a page refresh to a new page with only that view. This is happening in Firefox 3.5.3. IE 8 and Safari do not do this.

Also, will you give us access to the uploaded image file in future releases so we can create views that can include related info?

#30

hmm with some more testing, it seems that at least my issue is if I apply a Style to it of a Views Carousel. This may be more of an issue of interacting with other "styles"

#31

I can confirm the reports in the last few comments. I can make this bug appear by setting the row style to Advertisement and then selecting a style of Views Slideshow. In Firefox, the view immediately loads a new page, making it impossible to save your view. I could hug @hunterelliott in #29 for mentioning that IE doesn't have this problem -- I was able to load up the same view, choose the same settings, and save the ad.

Once you can get the view saved, then it works properly, but ... ouch.

#32

I can certainly confirm this behaviour in Firefox, I had not experienced it in IE. I assume that the Advertisement display code has some Javascript jailbreak code that is unique to Firefox (in some manner) in the display. I'll check if it's being invoked correctly as it does indeed make it very hard if you're using Firefox for the editing.

Update: The behaviour described is reproducible with #29 being a perfect description. In Firefox the Views edit window is replaced by the ad and consists of purely the ad. That is, no other html tags (head, body, etc.) - just a div tag containing the ad. In the default review that is referred to I had been using Row Style of 'default'. By changing it to 'raw' (which I've just done in the -dev branch) it sidesteps the problem temporarily allowing someone to at least create a Block view. Otherwise, don't use Firefox to do the editing. But that's not a solution. I had at first thought the problem was in the Ad module, I'm not so sure now because I observe that the "Add display" button causes Ajax refresh of the page which means the bug is either in Views itself, or in Firefox it doesn't quite grok the Javascript that is being served back. Investigating further.

Update: Okay, I follow what is happening. Where the Ad is served using Javascript there are actually header variables being set. IE sandboxes it, Firefox latches onto it and clobbers the page. In sort, Ad module probably wasn't written entirely with Views as a mode of display in mind.

The fix of setting display to 'raw' is appropriate for the moment, which I have done in -dev. When using Views support for Ad module that is the right way to do it. I'm seriously thinking of disabling all other row display types.

Cheers,

Miles

#33

I've left the other row display types but now with a warning. I'll issue a new release of the module within a week if no other comments, otherwise grab a copy of the -dev branch and try it out.

Cheers,

Miles

#34

I have a workaround for the preview problem. I am using Firefox but also have some issues with IE and preview.
At first I would use the back button on the browser to get back to the Views page. It would look like the settings were not saved but on saving the view the settings would be correct next time.
That was frustrating, so I created a second display using fields and set the preview to show that one. So now I can at least work on my views even though I cannot properly preview them.

#35

Congrats for a really great module.
Does Ad Views suport ad_flash advertisments ? Can i do something to help you in this direction ?
Thanks.
Alex

#36

ad_flash support should work out of the box. Is it not working? If not, give me specific details of what is/isn't happening.

Cheers,

Miles

#37

:) I was just wondering i haven't installed your module yet to test it but i was looking for this kind of functionality in the past. I have an ongoing project where i'll need it though so i'll let you know soon enough. Anywayz you might be right about working out of the box.

Cheers
Alex

#38

Status:needs review» closed (fixed)

I'm closing off this issue, a long history to it and nothing more that I can see needs doing. Raise a new issue that is specific to beta1 if you need to.

Cheers, Miles