I need to set up a contextual filter that will pass the information from a single row of a view into a new view that only shows that one row, using maybe a link that opens it into a new page or a PDF.
When a user clicks "Print" I would like the resulting page to just show the information from that one line...
Background
I have a view that lists a row of things in a table. It's data imported into MySQL that's not associated with a node. I need to build a view page certificate to use instead of Certificate.
The data is quiz scores and the fields are QID, Date, Course, Score and Print Certificate. The "Print Certificate" column is a Global: Math Expression field that basically compares the score (score
) with the global passing score variable (pass_rate
) and prints a link if the expression is not zero, otherwise the field is left blank. The expression I am using to accomplish this is: abs(([score]+1)-[pass_rate])+(([score]+1)-[pass_rate])
.
Course is a custom content type that is connected to the quiz that was taken. The quiz also links to the course so that it comes up in this view and Quiz is using the Quiz module.
What I've Tried
I created another view as a page that is similar to the view that shows all the scores, except I limited it to one item, excluding all fields from showing and I arranged it as an unordered list instead of a table. Using Global Text field which is not excluded, add back all the other fields using replacement patterns in order to control how the data is rendered so that it reads more like a certificate about one specific quiz score or QID. What needs to be done in order that the information displayed on this view page is the same as the row that linked to it, or just one QID?
Notes
So why not just use certificate? Biggest issues are that there is no token for when the certificate was earned or when the quiz was passed. See my SE post. The other reason is because the quiz scores were imported as values from another site. See my other SE post on this.
Ideas Can I use a contextual filter in the parent view with some php using the fetchfield() function such as something like:
db_query_range('SELECT 1 FROM {quiz_node_results} WHERE qid = :qid', 0, 1, array(':qid' => $[something]->qid))->fetchField();