Closed (fixed)
Project:
DART
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
20 Nov 2012 at 17:39 UTC
Updated:
20 May 2013 at 14:50 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
RKopacz commentedSubscribing.
Comment #2
breathingrock commentedAttached is a patch that should get you off the ground. It does NOT yet support AJAX. I'm currently working on that.
Tested myself, but let me know how it goes.
Tim
Comment #3
bleen commentedWow! This is very cool ... Thanks Tim. I cant wait to see it workin with AJAX :)
I know it looks like I changed *a lot* here, but really I just moved around a bunch of code, made some coding standards fixes, added some comments, etc... (see the interdiff to see what I changed) functionally I havent changed anything. I'm going to continue to play though.
Comment #4
breathingrock commentedAttached is a patch (based off your patch, bleen18) with AJAX support.
Critiques/Feedback welcome.
Tim
Comment #5
bleen commentedThe only thing I see a problem with so far is that it violates Drupal policy to include a 3rd party JS library in a Drupal module. Can we instead add a link somewhere (maybe during install in a drupal_set_message() or if you try to turn on the ajax features or something like that)
ref: http://drupal.org/node/422996
This si really great though!! Thanks @breathingrock
Comment #6
Snugug commentedI'm looking at this patch, and using it in an attempt to see how it works, and the output isn't quite what I would expect.
First, the ad gets inserted into the row itself as opposed to a new row, so while it keeps the same number of items returned, the way most people would treat the ad would be as a separate entity, and because it's inserted into an existing row instead of a new row, we are unable to do this. A specific use case for this? Pulling in images using views to make a gallery, and having one slide be an ad. Can't do that with the current implementation.
Second, because it doesn't get added as a new row and gets appended to existing results, and additionally because it gets appended to the top of each result without an option to change that, there is currently no way to have an ad be the last result in a query. If I've got three items and I want the ad to be the fourth item, I expect the ad to show up regardless of whether or not there is a result there, not to simply not display (or at least an option to do so).
Comment #7
Snugug commentedThe way the view row count carries between different views on the same page is also very unintuitive. I've got one view providing two separate blocks with different view modes. One has 3 items, one is a paged list. Both are being displayed on one page. The ad placement on one block is taking into consideration the number of views rows already on the page, producing undesired results. Example:
Block 1: Ad placement on 4, block has 3 results.
Block 2: Ad placement on 4, block has 4 results paged.
Results on page:
Block 1 item 1
Block 1 item 2
Block 1 item 3
Block 2 ad
Block 2 item 2
Block 2 item 3
This seems like a bug, not a feature, and an unexpected result. Also, not being able to set ads to repeat every N blocks is a killer, doubly so because we're only limited to three ad inserts and if we've got a long list of items, ads will stop when we will probably want them to keep going.
Comment #8
Snugug commentedAlso, it seems as if it doesn't work with AJAX pagination, specifically with Views Load More enabled.
Comment #9
breathingrock commentedSnugug,
Give this patch a try.
The DART module doesn't declare its own entity type, but I have separated the ads and nodes into their own rows. This ought to take care of your primary concerns. Tested with multiple blocks on a page (along with the same view for page content) and all look to be working independently from one another.
I didn't have time to debug the Views Load More issues. And I wouldn't think implementing a every-nth-row feature would be that difficult. I'll see what I can do about these tasks by next weekend.
@bleen18 - I'll work your idea re: the WriteCapture library in with the above stuff as well.
Tim
Comment #10
Snugug commentedSo! The new row stuff works an absolute charm! The issue that I'm now running into is, with the same setup as before, but now using any paged view mode (including Views standard pager), views_plugin_pager_full is timing out and throwing a PHP Fatal, preventing the page from rendering. This is with AJAX pagination. If I've got either "Display Set Number Of Items" or "Display All Items" as my pager mode, it all works fine. Any pager will WSOD the page.
Comment #11
breathingrock commentedSnugug,
I could not reproduce this problem. Could it be an incompatibility with another custom/contrib module? I'm working on a clean Drupal install with only a standard set of contrib modules enabled.
I'm going to see what I can do about the every nth ad position.
Tim
Comment #12
breathingrock commentedAnd here's a patch with an option for setting an ad position interval, i.e. displaying an ad every nth row.
Tim
Comment #13
breathingrock commentedbleen - and here's the same patch as above that removes the writeCapture library from the module and warns the user if the writeCapture library isn't detected when editing the ad position settings in the view.
Comment #14
bleen commentedThere is a minuscule whitespace issue, but otherwise this looks great to me... Lets give Snugug a chance to test drive it and then I think we're ready to commit.
timverly++
white space issue...
Comment #15
Snugug commentedThis appears to be working with the exception of when choosing interval input and saving, Views spits out JSON instead of having the modal save and close. Do I need some JavaScript (it said something about writecapture jQuery being needed) in order for it to work properly?
Comment #16
breathingrock commentedAttached patch fixes the white space issue.
I uninstalled the WriteCapture library and couldn't replicate the JSON error. Not sure what could be causing it. Does everything point to this patch as the source of the problem on your end?
Btw, fixed the default interval values.
Comment #17
Snugug commentedTesting!
UPDATE:
Fresh DL of the module, patched, caches cleared. The "Content with DART Ads" option is available, but whenever I go to select it, the selection fails (apply, no options, style doesn't change).
Comment #18
Snugug commentedAnother update!
I've gotten past the previous roadblock, and while a fixed number of items with either a fixed position or an interval position, the moment I add any pager, including the standard pagers, the view render times out (
PHP Fatal error: Maximum execution time of 60 seconds exceeded). This is a pretty big blocker for this IMO.Comment #19
bleen commented... did this require any changes in code?
Comment #20
Snugug commentedPrevious roadblock was re: needing to re-install WriteCapture to my Libraries folder, but still have the Max Execution Time errors and every once and a while Views will spit back JSON instead of the view editor still.
Comment #21
bleen commentedbreathingrock: do you follow #20? Can you reproduce
Comment #22
breathingrock commentedNot getting either the timeouts / slow page loads or the JSON.
Snugug: Could you provide a .tgz of your codebase and a DB dump so I can install on my local?
Comment #23
breathingrock commentedHere's a patch with postscribe support. Haven't re-tested writecapture yet.
Comment #24
Snugug commentedStep 1) Create Drush command to download and install PostScribe.
Testing the rest now.
Comment #25
breathingrock commentedAnd here we've got writecapture support, as well as support for the load ads last feature already implemented in the module. The 2 didn't necessarily play nice.
Comment #26
bleen commentedsnugug mentioned that something might have been missing from teh views plugin yesterday.... has that been resolved?
Comment #27
breathingrock commentedFixing up Views library detection error message and export variables.
Comment #28
breathingrock commentedAnd this a bit more proper version of the above patch.
Comment #29
breathingrock commentedAnd additional support for static tags with AJAX views paging.
Comment #30
Snugug commentedThe only issue I'm currently having is that repeating ads don't actually display multiple versions of the ad. The first ad loads in fine, the other two I have on the page do not load in, but without error. Otherwise, all of the other errors that I've had have been solved.
This, BTW, is being tested with an AJAX pager.
Comment #31
bleen commentedCant have nbcudigitaladops specific code here...
Comment #32
breathingrock commentedRemoved the nbcudigitaladops conditional.
Comment #33
breathingrock commentedComment #34
bleen commentedI got a RTBC from Snugug in IRC today ... WOOOOT.
Committed to HEAD ... the only change I made was moving dart.js and dar.admin.js into the new js folder
Thanks!!
Comment #35
bleen commentedComment #37
jasom commentedHere is step-by-step tutorial how to insert custom code (adsense for example) after first and sixth row in your drupal 7 or drupal 8 views: http://www.jasom.net/how-to-add-custom-code-adsense-after-first-row-in-d...
Basically, you need to override your views-view-unformatted.tpl.php with this code