Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have been trying to create a very simple view with views_pdf that takes in the NID as a contextual filter and it doesn't seem to work. I have tried 7.x-1.1 and 7.x-1.x-dev with no luck. If i take off the contextual filter, i get it to work correct. I even tried it as a regular filter and it didn't work.
Comments
Comment #1
bdawg8569 CreditAttribution: bdawg8569 commentedDOH! I forgot i was working with unpublished content and had a filter to only show published content. My apologies. I'm an idiot. Works fine.
Comment #2
bdawg8569 CreditAttribution: bdawg8569 commentedClosing
Comment #3
themic8 CreditAttribution: themic8 commentedbdawg8569 are you using one node e.g. http://example.com/print_pdf/234 or multiple http://example.com/print_pdf/1,2,3,4
I am trying to get multple contexual qrguments to work but I don't think it is supported.
Comment #4
vegansupreme CreditAttribution: vegansupreme commented@themic8, multiple filters and multiple values are supported. The only thing that's tricky about multiple values is sometimes you need to use plus (+) separators and sometimes you need to use comma (,) separators. I just try both and see what works. As long as Configure contextual filter: > More > Allow multiple values is checked it seems to work just fine.
Comment #5
themic8 CreditAttribution: themic8 commentedvegansupreme,
Thank you for the update.
Where you using the 7.x-1.1 or 7.x-dev?
Comment #6
vegansupreme CreditAttribution: vegansupreme commentedI've tested contextual filters in 7.x-1.3, 1.4 and dev. I'm not sure about 7.x-1.1. but it should be fine. I'm not sure which version I've been using in production, but it's close to 7.x-1.1, or maybe even earlier; with lots of contextual filters and multiple values.
Comment #7
themic8 CreditAttribution: themic8 commentedVegansupreme,
Thank you for testing and for the update. I created a new view and not it is working.
Comment #8
kyleheney CreditAttribution: kyleheney commentedHi,
I'm having trouble getting Views PDF to work with Contextual Filters.
When I have a Contextual Filter in my view, it will only save a blank PDF to my server. When I remove the Contextual Filter, the PDF is displayed (though it's not what I want it to be since there is no contextual filter).
My View is of Webform Submissions.
My Rule uses "form-id" in the Views Arguments field.
The PDF is saved to the server, but comes up blank when there is a contextual filter.
Any help is appreciated.
Comment #9
Neeraj420 CreditAttribution: Neeraj420 as a volunteer commented@kyleheney Were you able to solve this problem, I am also having the same problem
Comment #10
RickJ CreditAttribution: RickJ commentedI've just checked this, and contextual filters work as expected, same as any other view type. Views-PDF doesn't do anything directly with contextual filters, they are handled by the main Views architecture.
Contextual filters can be a bit of a bear to get working properly, and the admin UI is not wonderfully intuitive, but I doubt the problem is anything specific to do with Views-PDF.